Quote Originally Posted by chronozphere
[pascal]
function Angle(X,Y: single): single;
begin
Result := 0;
if X = 0 then
if Y > 0 then Result := 180
else Result := 0;
Result := 180+RadToDeg(Arctan2(-X,Y));
end;
[/pascal]
Hmm,.. doesn't this always perform the last statement, regardless of what x and y are?