Chaosforge Forum
Coding => FPC Valkyrie => Topic started by: volos314 on May 17, 2007, 16:05
-
It's not a bug, but likely thing that makes people think you are not a math addict ))
function RealDistance(x1,y1,x2,y2 : Double): Double;
begin
RealDistance := Sqrt(Sqr(Abs(x2-x1)) + Sqr(Abs(y2-y1)));
end;
function TriDistance(x1,y1,x2,y2 : Integer): Byte;
begin
TriDistance := Round(Sqrt(Sqr(Abs(x2-x1)) + Sqr(Abs(y2-y1))));
end;
Abs is not necessary here.
-
This is one of the oldest if not *the* oldest Valkyrie unit :P. Anyway, next valkyrie release will have a proper math unit :P
-
And when is that?
-
Probably with the next Berserk! version :)
-
Will it be updated for 2.2.0, since Valk. seems to be incompatible already?
-
Actually some units will be 2.2.0 exclusive -- vdata will use generics now :)