GEOS 3.11.1
|
Utility functions for working with angles. More...
#include <Angle.h>
Static Public Member Functions | |
static double | toDegrees (double radians) |
static double | toRadians (double angleDegrees) |
static double | angle (const geom::Coordinate &p0, const geom::Coordinate &p1) |
Returns the angle of the vector from p0 to p1, relative to the positive X-axis. More... | |
static double | angle (const geom::Coordinate &p) |
Returns the angle that the vector from (0,0) to p, relative to the positive X-axis. More... | |
static bool | isAcute (const geom::Coordinate &p0, const geom::Coordinate &p1, const geom::Coordinate &p2) |
static bool | isObtuse (const geom::Coordinate &p0, const geom::Coordinate &p1, const geom::Coordinate &p2) |
static double | angleBetween (const geom::Coordinate &tip1, const geom::Coordinate &tail, const geom::Coordinate &tip2) |
static double | angleBetweenOriented (const geom::Coordinate &tip1, const geom::Coordinate &tail, const geom::Coordinate &tip2) |
static double | interiorAngle (const geom::Coordinate &p0, const geom::Coordinate &p1, const geom::Coordinate &p2) |
static int | getTurn (double ang1, double ang2) |
Returns whether an angle must turn clockwise or counterclockwise to overlap another angle. More... | |
static double | normalize (double angle) |
Computes the normalized value of an angle, which is the equivalent angle in the range ( -Pi, Pi ]. More... | |
static double | normalizePositive (double angle) |
Computes the normalized positive value of an angle, which is the equivalent angle in the range [ 0, 2*Pi ). More... | |
static double | diff (double ang1, double ang2) |
Utility functions for working with angles.
Unless otherwise noted, methods in this class express angles in radians.
|
static |
Returns the angle that the vector from (0,0) to p, relative to the positive X-axis.
The angle is normalized to be in the range ( -Pi, Pi ].
|
static |
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 ].
|
static |
Returns the unoriented smallest angle between two vectors.
The computed angle will be in the range [0, Pi).
tip1 | the tip of one vector |
tail | the tail of each vector |
tip2 | the tip of the other vector |
|
static |
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 rotation from v1 to v2; a negative result corresponds to a clockwise rotation.
tip1 | the tip of v1 |
tail | the tail of each vector |
tip2 | the tip of v2 |
|
static |
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].
ang1 | the angle of one vector (in [-Pi, Pi] ) |
ang2 | the angle of the other vector (in range [-Pi, Pi] ) |
|
static |
Returns whether an angle must turn clockwise or counterclockwise to overlap another angle.
ang1 | an angle (in radians) |
ang2 | an angle (in radians) |
|
static |
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]
p0 | a point of the ring |
p1 | the next point of the ring |
p2 | the next point of the ring |
p1
|
static |
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.
p0 | an endpoint of the angle |
p1 | the base of the angle |
p2 | the other endpoint of the angle |
|
static |
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.
p0 | an endpoint of the angle |
p1 | the base of the angle |
p2 | the other endpoint of the angle |
|
static |
Computes the normalized value of an angle, which is the equivalent angle in the range ( -Pi, Pi ].
angle | the angle to normalize |
|
static |
Computes the normalized positive value of an angle, which is the equivalent angle in the range [ 0, 2*Pi ).
E.g.:
angle | the angle to normalize, in radians |
|
static |
Converts from radians to degrees.
radians | an angle in radians |
|
static |
Converts from degrees to radians.
angleDegrees | an angle in degrees |