(cherry picked from commit 7bd56139540c86c521e66be74469749a2dc62b89)
@@ -142,6 +142,29 @@ begin
end;
function TPoint.Angle(const pt: TPoint): Single;
+
+ function arctan2(y,x : Single) : Single;
+ begin
+ if x=0 then
+ if y=0 then
+ result:=0.0
+ else if y>0 then
+ result:=pi/2
+ else
+ result:=-pi/2;
+ end
+ result:=ArcTan(y/x);
+ if x<0 then
+ if y<0 then
+ result:=result-pi
+ result:=result+pi;
+ end;
begin
result:=ArcTan2(y-pt.y,x-pt.x);
@@ -53,8 +53,6 @@ interface
implementation
-uses math;
-
{$undef read_interface}
{$define read_implementation}