#include <angle.h>
Accessors | |
| operator T () const throw () | |
| Cast operator. | |
| T | toRadian () const throw () |
| Return the value of the angle. | |
| T | toDegree () const throw () |
| Return the value of the angle. | |
| void | normalize (Range range) throw () |
| Normalize the angle over a given range. | |
| void | negate () throw () |
| Negate the angle. | |
| TAngle | operator+ () const throw () |
| Positive sign. | |
| TAngle | operator- () const throw () |
| Negative sign. | |
| TAngle & | operator+= (const TAngle &angle) throw () |
| Addition operator. | |
| TAngle & | operator+= (const T &val) throw () |
| Add a value to this angle. | |
| TAngle | operator+ (const TAngle &angle) throw () |
| Addition operator. | |
| TAngle & | operator-= (const TAngle &angle) throw () |
| Substraction operator. | |
| TAngle & | operator-= (const T &val) throw () |
| Substract a value from this angle. | |
| TAngle | operator- (const TAngle &angle) throw () |
| Subtraction an angle from this angle. | |
| TAngle & | operator *= (const TAngle &angle) throw () |
| Multiply an angle with this angle. | |
| TAngle & | operator *= (const T &val) throw () |
| Multiply a value with this angle. | |
| TAngle & | operator/= (const TAngle &angle) throw (Exception::DivisionByZero) |
| Division operator. | |
| TAngle & | operator/= (const T &val) throw (Exception::DivisionByZero) |
| Divide this angle by a value. | |
| TAngle | operator/ (const TAngle &val) throw (Exception::DivisionByZero) |
| Divide this angle by a value. | |
| T | toRadian (const T °ree) throw () |
| Calculate radians from degrees. | |
| T | toDegree (const T &radian) throw () |
| Calculate degrees from radians. | |
Public Types | |
Enums | |
| enum | Range { RANGE__UNLIMITED = 0, RANGE__UNSIGNED = 1, RANGE__SIGNED = 2 } |
form of the angle range: RANGE__UNLIMITED = 0 no limitations RANGE__UNSIGNED = 1 0 <= angle <= 360, 0 <= angle <= PI * 2 RANGE__SIGNED = 2 -180 <= angle <= 180, -PI <= angle <= PI | |
Public Member Functions | |
Constructors and Destructors | |
| TAngle () throw () | |
| Default constructor. | |
| TAngle (const TAngle &angle) throw () | |
| Copy constructor. | |
| TAngle (const T &new_value, bool radian=true) throw () | |
| Detailed constructor. | |
| virtual | ~TAngle () throw () |
| Destructor. | |
| virtual void | clear () throw () |
| Clear method The value is set to 0. | |
Assignment | |
| void | swap (TAngle &angle) throw () |
| Swap the contents of two angles. | |
| void | set (const T &new_value, bool radian=true) throw () |
| Assign a new value to the angle. | |
| void | set (const TAngle &angle) throw () |
| Assign an Angle object from another. | |
| TAngle & | operator= (const TAngle &angle) throw () |
| Assignment operator. | |
| TAngle & | operator= (const T &new_value) throw () |
| Assignment operator for floats. | |
| void | get (TAngle &angle) const throw () |
| Assign the value to another angle. | |
| void | get (T &val, bool radian=true) const throw () |
Assign the value to a variable of type T. | |
Predicates | |
| bool | operator== (const TAngle &angle) const throw () |
| Equality operator. | |
| bool | operator!= (const TAngle &angle) const throw () |
| Inequality operator This test uses Maths::isNotEqual instead of comparing the values directly. | |
| bool | operator< (const TAngle &angle) const throw () |
| Is less operator. | |
| bool | operator< (const T &val) const throw () |
| Is less operator. | |
| bool | operator<= (const TAngle &angle) const throw () |
| Is less or equal operator. | |
| bool | operator>= (const TAngle &angle) const throw () |
| Is greater or equal operator. | |
| bool | operator> (const TAngle &angle) const throw () |
| Is greater operator. | |
| bool | isEquivalent (TAngle angle) const throw () |
| Test whether two angles are equivalent. | |
Debugging and Diagnostics | |
| bool | isValid () const throw () |
| Test whether instance is valid. | |
| void | dump (std::ostream &s=std::cout, Size depth=0) const throw () |
| Internal state dump. | |
Public Attributes | |
Attributes | |
| T | value |
| The value. | |
Use this class to describe angles. The TAngle class permits the conversion from degree to radians and is the return type of all functions used to calculate angles.
|
|||||||||
|
Default constructor. Creates a new angle object. Its value is set to 0. |
|
||||||||||
|
Copy constructor. Create a copy of a TAngle object. Copies are always shallow.
|
|
||||||||||||||||
|
Detailed constructor.
Create a new angle object and set its value to
|
|
|||||||||
|
Destructor.
|
|
|||||||||
|
Clear method The value is set to 0.
|
|
||||||||||||||||
|
Internal state dump. Dump the current internal state of {*this} to the output ostream s with dumping depth depth .
|
|
||||||||||||||||
|
Assign the value to a variable of type
|
|
||||||||||
|
Assign the value to another angle.
|
|
||||||||||
|
Test whether two angles are equivalent. Both angles are normalized and afterwards compared with Maths::isEqual instead of comparing the values directly.
|
|
|||||||||
|
Test whether instance is valid. Always returns true
|
|
||||||||||
|
Normalize the angle over a given range.
|
|
||||||||||
|
Multiply a value with this angle.
|
|
||||||||||
|
Multiply an angle with this angle.
|
|
|||||||||
|
Cast operator.
|
|
||||||||||
|
Inequality operator This test uses Maths::isNotEqual instead of comparing the values directly.
|
|
||||||||||
|
Addition operator.
|
|
|||||||||
|
Positive sign.
|
|
||||||||||
|
Add a value to this angle.
|
|
||||||||||
|
Addition operator.
|
|
||||||||||
|
Subtraction an angle from this angle.
|
|
|||||||||
|
Negative sign.
|
|
||||||||||
|
Substract a value from this angle.
|
|
||||||||||
|
Substraction operator.
|
|
||||||||||
|
Divide this angle by a value.
|
|
||||||||||
|
Divide this angle by a value.
|
|
||||||||||
|
Division operator.
|
|
||||||||||
|
Is less operator. This test uses Maths::isLess instead of comparing the values directly.
|
|
||||||||||
|
Is less operator. This test uses Maths::isLess instead of comparing the values directly.
|
|
||||||||||
|
Is less or equal operator. This test uses Maths::isLessOrEqual instead of comparing the values directly.
|
|
||||||||||
|
Assignment operator for floats. Assign a float value to the angle. The assigned value has to be in radians!
|
|
||||||||||
|
Equality operator. This test uses Maths::isEqual instead of comparing the values directly.
|
|
||||||||||
|
Is greater operator. This test uses Maths::isGreater instead of comparing the values directly.
|
|
||||||||||
|
Is greater or equal operator. This test uses Maths::isGreaterOrEqual instead of comparing the values directly.
|
|
||||||||||
|
Assign an Angle object from another.
|
|
||||||||||||||||
|
Assign a new value to the angle.
|
|
||||||||||
|
Swap the contents of two angles.
|
|
||||||||||
|
Calculate degrees from radians.
|
|
|||||||||
|
Return the value of the angle.
|
|
||||||||||
|
Calculate radians from degrees.
|
|
|||||||||
|
Return the value of the angle.
|