#include <Angle.h>
Static Public Member Functions | |
double | toDegrees (double radians) |
Converts from radians to degrees. | |
double | toRadians (double angleDegrees) |
Converts from degrees to radians. | |
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. | |
double | angle (const geom::Coordinate &p) |
Returns the angle that the vector from (0,0) to p, relative to the positive X-axis. | |
bool | isAcute (const geom::Coordinate &p0, const geom::Coordinate &p1, const geom::Coordinate &p2) |
Tests whether the angle between p0-p1-p2 is acute. | |
bool | isObtuse (const geom::Coordinate &p0, const geom::Coordinate &p1, const geom::Coordinate &p2) |
Tests whether the angle between p0-p1-p2 is obtuse. | |
double | angleBetween (const geom::Coordinate &tip1, const geom::Coordinate &tail, const geom::Coordinate &tip2) |
Returns the unoriented smallest angle between two vectors. | |
double | angleBetweenOriented (const geom::Coordinate &tip1, const geom::Coordinate &tail, const geom::Coordinate &tip2) |
Returns the oriented smallest angle between two vectors. | |
double | interiorAngle (const geom::Coordinate &p0, const geom::Coordinate &p1, const geom::Coordinate &p2) |
Computes the interior angle between two segments of a ring. | |
int | getTurn (double ang1, double ang2) |
Returns whether an angle must turn clockwise or counterclockwise to overlap another angle. | |
double | normalize (double angle) |
Computes the normalized value of an angle, which is the equivalent angle in the range ( -Pi, Pi ]. | |
double | normalizePositive (double angle) |
Computes the normalized positive value of an angle, which is the equivalent angle in the range [ 0, 2*Pi ). | |
double | diff (double ang1, double ang2) |
Computes the unoriented smallest difference between two angles. | |
Static Public Attributes | |
const double | PI_TIMES_2 |
const double | PI_OVER_2 |
const double | PI_OVER_4 |
const int | COUNTERCLOCKWISE = CGAlgorithms::COUNTERCLOCKWISE |
Constant representing counterclockwise orientation. | |
const int | CLOCKWISE = CGAlgorithms::CLOCKWISE |
Constant representing clockwise orientation. | |
const int | NONE = CGAlgorithms::COLLINEAR |
Constant representing no orientation. |
Unless otherwise noted, methods in this class express angles in radians.
|
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 ].
|
|
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 unoriented smallest angle between two vectors. The computed angle will be in the range [0, Pi).
|
|
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.
|
|
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].
|
|
Returns whether an angle must turn clockwise or counterclockwise to overlap another angle.
|
|
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]
|
|
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 (determistic) for angles very close to 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 (determistic) for angles very close to 90 degrees.
|
|
Computes the normalized value of an angle, which is the 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.:
|
|
Converts from radians to degrees.
|
|
Converts from degrees to radians.
|