System.Types.TPointF.Angle
Delphi
function Angle(const APoint: TPointF): Single;
C++
float Angle(const TPointF &P) const _ALWAYS_INLINE {
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.Types.pas SystemTypes.h |
System.Types | TPointF |
Description
Calculates the angle in radians formed by the point and the APoint parameter relative to the X-Axis using an Arctan2 function.
Result := Arctan2(Self.Y - APoint.Y, Self.X - APoint.X);
Angle is equivalent to Arctan2(X, Y)
, which is the angle in radians between the positive X-axis of a plane and the point given by the coordinates (X, Y) on the plane. The angle is positive for counter-clockwise angles (upper half-plane, Y > 0), and negative for clockwise angles (lower half-plane, Y < 0).
Arctan2(0, 0)
is 0, because normally Arctan2(0, 0)
is undefined.