#include <DLAngle.h>
A representation of an angle measured from the horizontal (positive x-axis) in the counterclockwise direction.
Definition at line 11 of file DLAngle.h.
Some commonly-used specific values for angles. Some algorithms may check for this attribute of an inputted angle to simplify their calculations.
A DLAngle is not marked as special unless specifically constructed that way; therefore, only the first of these otherwise equivalent DLAngles is "special":
DLAngle one35a(DLAngle::DL_135_DEGREE_ANGLE); DLAngle one35b(135, DLAngle::DL_DEGREES);
In general, the output of operations (such as +, -, += and -=) on special DLAngles will no longer be special. In the following example,
DLAngle right(DLAngle::DL_RIGHT_ANGLE); DLAngle straight = right + right;
straight
will not be marked with a DLSpecialAngleType. enum DLAngle::DLQuadrant |
The four quadrants of a Cartesian coordinate system.
DLAngle::DLAngle | ( | ) | [inline] |
Default DLAngle constructor; creates an angle of 0 radians.
Definition at line 21 of file DLAngle.h.
Referenced by operator-().
DLAngle::DLAngle | ( | const DLAngle & | orig | ) | [inline] |
virtual DLAngle::~DLAngle | ( | ) | [inline, virtual] |
DLAngle::DLAngle | ( | double | radians | ) |
Constructor: Creates a DLAngle from a value in radians.
DLAngle::DLAngle | ( | double | value, | |
DLAngleUnits | units | |||
) |
Constructor: Creates a DLAngle from a value in any of the typical representations.
Examples:
DLAngle theta1(30, DLAngle::DL_DEGREES); DLAngle theta2(DL_PI_OVER_2, DLAngle::DL_RADIANS);
DLAngle::DLAngle | ( | double | degrees, | |
double | minutes, | |||
double | seconds | |||
) |
Constructor: Creates a DLAngle from the degrees-minutes-seconds representation.
DLAngle::DLAngle | ( | DLSpecialAngleType | type | ) |
Constructor: Creates one of several particular DLAngles.
Example:
DLAngle theta(DLAngle::DL_45_DEGREE_ANGLE);
Assignment operator.
right | DLAngle to copy |
Definition at line 35 of file DLAngle.h.
References angle, and specialType.
double DLAngle::dlRadians | ( | ) | const |
double DLAngle::dlDegrees | ( | ) | const |
double DLAngle::dlGrads | ( | ) | const |
bool DLAngle::dlIsSpecial | ( | ) | const |
true
if the angle is marked as one of the special types in DLAngle::DLSpecialAngleType false
if the angle is of arbitrary measure (DLAngle::DL_ARBITRARY) DLSpecialAngleType DLAngle::dlGetSpecialAngleType | ( | ) | const [inline] |
DLQuadrant DLAngle::dlQuadrant | ( | ) | const |
Counterclockwise angle rotation.
p2 | DLAngle to rotate by |
Clockwise angle rotation.
p2 | DLAngle to rotate by |
const DLAngle DLAngle::operator- | ( | ) | const [inline] |
bool DLAngle::operator== | ( | const DLAngle & | p2 | ) | const [inline] |
Equality operator (compare two angles)
p2 | DLAngle to compare to |
Definition at line 233 of file DLAngle.h.
References angle, and specialType.
DLAngle::operator double | ( | ) | const [inline] |
Conversion to double
operator.
Allows an angle to be used as input to functions that require input of type double
, for example:
DLAngle theta; double length; ... double y = length * sin(theta); cout << "angle theta, in radians: " << theta << endl;
void DLAngle::dlReduce | ( | ) |
Convert the DLAngle to an angle in the range radians.
The difference of two DLAngles.