An angle and related functions. More...
#include <ignition/math/Angle.hh>
Public Member Functions | |
Angle () | |
Constructor. More... | |
Angle (const double _radian) | |
Conversion Constructor. More... | |
Angle (const Angle &_angle) | |
Copy constructor. More... | |
virtual | ~Angle () |
Destructor. More... | |
void | Degree (double _degree) |
Set the value from an angle in degrees. More... | |
double | Degree () const |
Get the angle in degrees. More... | |
void | Normalize () |
Normalize the angle in the range -Pi to Pi. More... | |
bool | operator!= (const Angle &_angle) const |
Inequality. More... | |
double | operator() () const |
Return the angle's radian value. More... | |
double | operator* () const |
Dereference operator. More... | |
Angle | operator* (const Angle &_angle) const |
Multiplication operator, result = this * _angle. More... | |
Angle | operator*= (const Angle &_angle) |
Multiplication set, this = this * _angle. More... | |
Angle | operator+ (const Angle &_angle) const |
Addition operator, result = this + _angle. More... | |
Angle | operator+= (const Angle &_angle) |
Addition set, this = this + _angle. More... | |
Angle | operator- (const Angle &_angle) const |
Substraction, result = this - _angle. More... | |
Angle | operator-= (const Angle &_angle) |
Subtraction set, this = this - _angle. More... | |
Angle | operator/ (const Angle &_angle) const |
Division, result = this / _angle. More... | |
Angle | operator/= (const Angle &_angle) |
Division set, this = this / _angle. More... | |
bool | operator< (const Angle &_angle) const |
Less than operator. More... | |
bool | operator<= (const Angle &_angle) const |
Less or equal operator. More... | |
bool | operator== (const Angle &_angle) const |
Equality operator, result = this == _angle. More... | |
bool | operator> (const Angle &_angle) const |
Greater than operator. More... | |
bool | operator>= (const Angle &_angle) const |
Greater or equal operator. More... | |
void | Radian (double _radian) |
Set the value from an angle in radians. More... | |
double | Radian () const |
Get the angle in radians. More... | |
Static Public Attributes | |
static const Angle | HalfPi |
math::Angle(IGN_PI * 0.5) More... | |
static const Angle | Pi |
math::Angle(IGN_PI) More... | |
static const Angle | TwoPi |
math::Angle(IGN_PI * 2) More... | |
static const Angle | Zero |
math::Angle(0) More... | |
Friends | |
std::ostream & | operator<< (std::ostream &_out, const Angle &_a) |
Stream insertion operator. Outputs in degrees. More... | |
std::istream & | operator>> (std::istream &_in, Angle &_a) |
Stream extraction operator. Assumes input is in radians. More... | |
Detailed Description
An angle and related functions.
Constructor & Destructor Documentation
◆ Angle() [1/3]
Angle | ( | ) |
Constructor.
◆ Angle() [2/3]
Angle | ( | const double | _radian | ) |
Conversion Constructor.
- Parameters
-
[in] _radian Radians
◆ Angle() [3/3]
◆ ~Angle()
|
virtual |
Destructor.
Member Function Documentation
◆ Degree() [1/2]
void Degree | ( | double | _degree | ) |
Set the value from an angle in degrees.
- Parameters
-
[in] _degree Degree value
◆ Degree() [2/2]
double Degree | ( | ) | const |
Get the angle in degrees.
- Returns
- double containing the angle's degree value
◆ Normalize()
void Normalize | ( | ) |
Normalize the angle in the range -Pi to Pi.
Referenced by MassMatrix3< T >::PrincipalAxesOffset().
◆ operator!=()
bool operator!= | ( | const Angle & | _angle | ) | const |
Inequality.
- Parameters
-
[in] _angle Angle to check for inequality
- Returns
- true if this != _angle
Referenced by Angle::operator*().
◆ operator()()
double operator() | ( | ) | const |
Return the angle's radian value.
- Returns
- double containing the angle's radian value
◆ operator*() [1/2]
|
inline |
Dereference operator.
- Returns
- Double containing the angle's radian value
References Angle::operator!=(), Angle::operator*=(), Angle::operator+(), Angle::operator+=(), Angle::operator-(), Angle::operator-=(), Angle::operator/(), Angle::operator/=(), Angle::operator<(), Angle::operator<=(), Angle::operator==(), Angle::operator>(), and Angle::operator>=().
◆ operator*() [2/2]
Multiplication operator, result = this * _angle.
- Parameters
-
[in] _angle Angle for multiplication
- Returns
- the new angle
◆ operator*=()
Multiplication set, this = this * _angle.
- Parameters
-
[in] _angle Angle for multiplication
- Returns
- angle
Referenced by Angle::operator*().
◆ operator+()
Addition operator, result = this + _angle.
- Parameters
-
[in] _angle Angle for addition
- Returns
- the new angle
Referenced by Angle::operator*().
◆ operator+=()
Addition set, this = this + _angle.
- Parameters
-
[in] _angle Angle for addition
- Returns
- angle
Referenced by Angle::operator*().
◆ operator-()
Substraction, result = this - _angle.
- Parameters
-
[in] _angle Angle for substraction
- Returns
- the new angle
Referenced by Angle::operator*().
◆ operator-=()
Subtraction set, this = this - _angle.
- Parameters
-
[in] _angle Angle for subtraction
- Returns
- angle
Referenced by Angle::operator*().
◆ operator/()
Division, result = this / _angle.
- Parameters
-
[in] _angle Angle for division
- Returns
- the new angle
Referenced by Angle::operator*().
◆ operator/=()
Division set, this = this / _angle.
- Parameters
-
[in] _angle Angle for division
- Returns
- angle
Referenced by Angle::operator*().
◆ operator<()
bool operator< | ( | const Angle & | _angle | ) | const |
Less than operator.
- Parameters
-
[in] _angle Angle to check
- Returns
- true if this < _angle
Referenced by Angle::operator*().
◆ operator<=()
bool operator<= | ( | const Angle & | _angle | ) | const |
Less or equal operator.
- Parameters
-
[in] _angle Angle to check
- Returns
- true if this <= _angle
Referenced by Angle::operator*().
◆ operator==()
bool operator== | ( | const Angle & | _angle | ) | const |
Equality operator, result = this == _angle.
- Parameters
-
[in] _angle Angle to check for equality
- Returns
- true if this == _angle
Referenced by Angle::operator*().
◆ operator>()
bool operator> | ( | const Angle & | _angle | ) | const |
Greater than operator.
- Parameters
-
[in] _angle Angle to check
- Returns
- true if this > _angle
Referenced by Angle::operator*().
◆ operator>=()
bool operator>= | ( | const Angle & | _angle | ) | const |
Greater or equal operator.
- Parameters
-
[in] _angle Angle to check
- Returns
- true if this >= _angle
Referenced by Angle::operator*().
◆ Radian() [1/2]
void Radian | ( | double | _radian | ) |
Set the value from an angle in radians.
- Parameters
-
[in] _radian Radian value
Referenced by MassMatrix3< T >::PrincipalAxesOffset().
◆ Radian() [2/2]
double Radian | ( | ) | const |
Get the angle in radians.
- Returns
- double containing the angle's radian value
Friends And Related Function Documentation
◆ operator<<
|
friend |
Stream insertion operator. Outputs in degrees.
- Parameters
-
[in] _out output stream [in] _a angle to output
- Returns
- The output stream
◆ operator>>
|
friend |
Stream extraction operator. Assumes input is in radians.
- Parameters
-
[in,out] _in input stream [out] _a angle to read value into
- Returns
- The input stream
Member Data Documentation
◆ HalfPi
|
static |
math::Angle(IGN_PI * 0.5)
◆ Pi
|
static |
math::Angle(IGN_PI)
◆ TwoPi
|
static |
math::Angle(IGN_PI * 2)
◆ Zero
|
static |
math::Angle(0)
The documentation for this class was generated from the following file: