во че нашел
delphi Код:
function sgn (a : real) : real;
begin
if a < 0 then result := -1
else result := 1;
end;
function atan2(y, x : real) : real;
begin
if x > 0 then result := arctan (y/x)
else if x < 0 then result := arctan (y/x) + pi
else result := pi/2 * sgn (y);
end;