Apparently there's already functions for all this stuff...

Apparently there's already functions for all this stuff...
Last edited by Function; 01-25-2010 at 01:35 AM.
This looks more like the midpoint formula than the distance formula...
:-)

how does 0, 0 and 5, 5, result a mid point of (2, 2)?
![]()

haahhaha
SCAR Code:program Midpoint;
var
x1, y1, x2, y2: Extended;
procedure Points;
begin
x1 := 0;
y1 := 0;
x2 := 5;
y2 := 5;
end;
procedure MidPoint;
var
x, y: Extended;
begin
x := (x2 + x1) div 2;
y := (y2 + y1) div 2;
WriteLn('The Midpoint between (' + FloatToStr(x1) + ', ' + FloatToStr(y1) + ') and (' +
FloatToStr(x2) + ', ' + FloatToStr(y2) + ') is (' +
FloatToStr(x) + ', ' + FloatToStr(y) + ')!');
end;
begin
Points;
MidPoint;
end.
Code:Successfully compiled (7 ms) The Midpoint between (0, 0) and (5, 5) is (2.5, 2.5)! Successfully executed


Distance:
Midpoint:SCAR Code:Distance(x1, y1, x2, y2);
SCAR Code:MiddleTPA([Point(x1, y1), Point(x2, y2)]);

Isn't MiddleTPA abstract though? It's customized to find the center of a blob or something?
The best way to contact me is by email, which you can find on my website: http://wizzup.org
I also get email notifications of private messages, though.
Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
Documentation | Source | Simba Bug Tracker on Github and Villavu )
My (Blog | Website)
Well in this case it's clearly wrongly defined behaviour though, thus you can see it in a funny way.
Oh well, trial 'n error is your best teacher.
I made a new script, check it out!.
There are currently 1 users browsing this thread. (0 members and 1 guests)