Angle
Utility functions for working with angles. Unless otherwise noted, methods in this class express angles in radians.
Value members
Concrete methods
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 ].
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 ].
- Value Params
- p0
the initial point of the vector
- p1
the terminal point of the vector return the normalized angle (in radians) that p0-p1 makes with the positive x-axis.
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 ].
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 ].
- Value Params
- p
the terminal point of the vector return the normalized angle (in radians) that p makes with the positive x-axis.
Returns the unoriented smallest angle between two vectors. The computed angle will be in the range [0, Pi).
Returns the unoriented smallest angle between two vectors. The computed angle will be in the range [0, Pi).
- Value Params
- tail
the tail of each vector
- tip1
the tip of one vector
- tip2
the tip of the other vector return the angle between tail-tip1 and tail-tip2
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.
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.
- Value Params
- tail
the tail of each vector
- tip1
the tip of v1
- tip2
the tip of v2 return the angle between v1 and v2, relative to v1
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].
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].
- Value Params
- ang1
the angle of one vector (in [-Pi, Pi] )
- ang2
the angle of the other vector (in range [-Pi, Pi] ) return the angle (in radians) between the two vectors (in range [0, Pi] )
Returns whether an angle must turn clockwise or counterclockwise to overlap another angle.
Returns whether an angle must turn clockwise or counterclockwise to overlap another angle.
- Value Params
- ang1
an angle (in radians)
- ang2
an angle (in radians) return whether a1 must turn CLOCKWISE, COUNTERCLOCKWISE or NONE to overlap a2.
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]
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]
- Value Params
- p0
a point of the ring
- p1
the next point of the ring
- p2
the next point of the ring return the interior angle based at <code>p1</code>
Tests whether the angle between p0-p1-p2 is acute. An angle is acute if it is less than 90 degrees.
Tests whether the angle between p0-p1-p2 is acute. An angle is acute if it is less than 90 degrees.
Note: this implementation is not precise (deterministic) for angles very close to 90 degrees.
- Value Params
- p0
an endpoint of the angle
- p1
the base of the angle
- p2
the other endpoint of the angle return true if the angle is acute
Tests whether the angle between p0-p1-p2 is obtuse. An angle is obtuse if it is greater than 90 degrees.
Tests whether the angle between p0-p1-p2 is obtuse. An angle is obtuse if it is greater than 90 degrees.
Note: this implementation is not precise (deterministic) for angles very close to 90 degrees.
- Value Params
- p0
an endpoint of the angle
- p1
the base of the angle
- p2
the other endpoint of the angle return true if the angle is obtuse
Computes the normalized value of an angle, which is the equivalent angle in the range ( -Pi, Pi ].
Computes the normalized value of an angle, which is the equivalent angle in the range ( -Pi, Pi ].
- Value Params
- angle
the angle to normalize return an equivalent angle in the range (-Pi, Pi]
Computes the normalized positive value of an angle, which is the equivalent angle in the range [ 0, 2*Pi ). E.g.:
Computes the normalized positive value of an angle, which is the equivalent angle in the range [ 0, 2*Pi ). E.g.:
-
normalizePositive(0.0) = 0.0
-
normalizePositive(-PI) = PI
-
normalizePositive(-2PI) = 0.0
-
normalizePositive(-3PI) = PI
-
normalizePositive(-4PI) = 0
-
normalizePositive(PI) = PI
-
normalizePositive(2PI) = 0.0
-
normalizePositive(3PI) = PI
-
normalizePositive(4PI) = 0.0
- Value Params
- angle
the angle to normalize, in radians return an equivalent positive angle
Converts from radians to degrees.
Converts from radians to degrees.
- Value Params
- radians
an angle in radians return the angle in degrees