mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-09 00:08:12 +02:00
* Tpoint.Angle initial version using arctan2
(cherry picked from commit 5fb88cef00
)
This commit is contained in:
parent
12c586f22e
commit
66bfb69e96
@ -141,6 +141,11 @@ begin
|
||||
y:=y+dy;
|
||||
end;
|
||||
|
||||
function TPoint.Angle(const pt: TPoint): Single;
|
||||
begin
|
||||
result:=ArcTan2(y-pt.y,x-pt.x);
|
||||
end;
|
||||
|
||||
class operator TPoint.= (const apt1, apt2 : TPoint) : Boolean;
|
||||
begin
|
||||
result:=(apt1.x=apt2.x) and (apt1.y=apt2.y);
|
||||
|
@ -59,6 +59,8 @@
|
||||
end;
|
||||
PSize =^TSize;
|
||||
|
||||
{ TPoint }
|
||||
|
||||
TPoint =
|
||||
{$ifndef FPC_REQUIRES_PROPER_ALIGNMENT}
|
||||
packed
|
||||
@ -79,6 +81,7 @@
|
||||
procedure SetLocation(ax,ay : Longint);
|
||||
procedure Offset(const apt :TPoint);
|
||||
procedure Offset(dx,dy : Longint);
|
||||
function Angle(const pt : TPoint):Single;
|
||||
class function PointInCircle(const apt, acenter: TPoint; const aradius: Integer): Boolean; static; inline;
|
||||
class operator = (const apt1, apt2 : TPoint) : Boolean;
|
||||
class operator <> (const apt1, apt2 : TPoint): Boolean;
|
||||
|
@ -53,6 +53,8 @@ interface
|
||||
|
||||
implementation
|
||||
|
||||
uses math;
|
||||
|
||||
{$undef read_interface}
|
||||
{$define read_implementation}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user