Angle class

Utility functions for working with angles. Unless otherwise noted, methods in this class express angles in radians.

Constructors

Angle()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

CLOCKWISE int
Constant representing clockwise orientation
final
COUNTERCLOCKWISE int
Constant representing counterclockwise orientation
final
NONE int
Constant representing no orientation
final
PI_OVER_2 double
The value of Pi/2
final
PI_OVER_4 double
The value of Pi/4
final
PI_TIMES_2 double
The value of 2*Pi
final

Static Methods

angle(Coordinate p) double
Returns the angle of the vector from (0,0) to p, relative to the positive X-axis. The angle is normalized to be in the range ( -Pi, Pi ].
angle2C(Coordinate p0, Coordinate p1) double
Returns the angle of the vector from p0 to p1, relative to the positive X-axis. The angle is normalized to be in the range -Pi, Pi .
angleBetween(Coordinate tip1, Coordinate tail, Coordinate tip2) double
Returns the unoriented smallest angle between two vectors. The computed angle will be in the range [0, Pi).
angleBetweenOriented(Coordinate tip1, Coordinate tail, Coordinate tip2) double
Returns the oriented smallest angle between two vectors. The computed angle will be in the range (-Pi, Pi]. A positive result corresponds to a counterclockwise (CCW) rotation from v1 to v2; a negative result corresponds to a clockwise (CW) rotation; a zero result corresponds to no rotation.
diff(double ang1, double ang2) double
Computes the unoriented smallest difference between two angles. The angles are assumed to be normalized to the range -Pi, Pi. The result will be in the range 0, Pi.
getTurn(double ang1, double ang2) int
Returns whether an angle must turn clockwise or counterclockwise to overlap another angle.
interiorAngle(Coordinate p0, Coordinate p1, Coordinate p2) double
Computes the interior angle between two segments of a ring. The ring is assumed to be oriented in a clockwise direction. The computed angle will be in the range 0, 2Pi
isAcute(Coordinate p0, Coordinate p1, Coordinate p2) bool
Tests whether the angle between p0-p1-p2 is acute. An angle is acute if it is less than 90 degrees.
isObtuse(Coordinate p0, Coordinate p1, Coordinate p2) bool
Tests whether the angle between p0-p1-p2 is obtuse. An angle is obtuse if it is greater than 90 degrees.
normalize(double angle) double
Computes the normalized value of an angle, which is the equivalent angle in the range ( -Pi, Pi ].
normalizePositive(double angle) double
Computes the normalized positive value of an angle, which is the equivalent angle in the range [ 0, 2*Pi ). E.g.:
toDegrees(double radians) double
Converts from radians to degrees. @param radians an angle in radians @return the angle in degrees
toRadians(double angleDegrees) double
Converts from degrees to radians.