Chaosforge Forum

Coding => FPC Valkyrie => Topic started by: volos314 on May 17, 2007, 16:05

Title: math.pas
Post 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.
Title: Re: math.pas
Post by: Kornel Kisielewicz on May 17, 2007, 22:12
This is one of the oldest if not *the* oldest Valkyrie unit :P. Anyway, next valkyrie release will have a proper math unit :P
Title: Re: math.pas
Post by: Igor Savin on May 21, 2007, 13:36
And when is that?
Title: Re: math.pas
Post by: Kornel Kisielewicz on May 22, 2007, 09:32
Probably with the next Berserk! version :)
Title: Re: math.pas
Post by: Igor Savin on May 27, 2007, 11:54
Will it be updated for 2.2.0, since Valk. seems to be incompatible already?
Title: Re: math.pas
Post by: Kornel Kisielewicz on May 27, 2007, 13:35
Actually some units will be 2.2.0 exclusive -- vdata will use generics now :)