KingKong
2011-05-19 02:53:28
This is the inbuilt function:
It returns an integer instead of an extended type, something like this would be a good one:
function Distance(xs:LongInt; xs:LongInt; xs:LongInt; xs:LongInt):LongIntIt returns an integer instead of an extended type, something like this would be a good one:
function Distance(xs, ys, xe, ye: Extended): Extended;
var
distx, disty: Extended;
begin
distx := Abs(xs - xe);
disty := Abs(ys - ye);
Result:= Sqrt(Sqr(distx) + Sqr(disty));
end;