An angle and related functions. More...
#include <ignition/math/Angle.hh>
Public Member Functions | |
Angle () | |
Constructor. More... | |
Angle (double _radian) | |
Copy 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 |
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 ignition::math::Angle &_a) |
Stream insertion operator. More... | |
std::istream & | operator>> (std::istream &_in, ignition::math::Angle &_a) |
Stream extraction operator. More... | |
An angle and related functions.
ignition::math::Angle::Angle | ( | ) |
Constructor.
ignition::math::Angle::Angle | ( | double | _radian | ) |
Copy Constructor.
[in] | _radian | Radians |
ignition::math::Angle::Angle | ( | const Angle & | _angle | ) |
Copy constructor.
[in] | _angle | Angle to copy |
|
virtual |
Destructor.
void ignition::math::Angle::Degree | ( | double | _degree | ) |
Set the value from an angle in degrees.
[in] | _degree | Degree value |
double ignition::math::Angle::Degree | ( | ) | const |
Get the angle in degrees.
void ignition::math::Angle::Normalize | ( | ) |
Normalize the angle in the range -Pi to Pi.
bool ignition::math::Angle::operator!= | ( | const Angle & | _angle | ) | const |
|
inline |
Dereference operator.
Multiplication operator, result = this * _angle.
[in] | _angle | Angle for multiplication |
Multiplication set, this = this * _angle.
[in] | _angle | Angle for multiplication |
Addition operator, result = this + _angle.
[in] | _angle | Angle for addition |
Substraction, result = this - _angle.
[in] | _angle | Angle for substraction |
bool ignition::math::Angle::operator< | ( | const Angle & | _angle | ) | const |
bool ignition::math::Angle::operator<= | ( | const Angle & | _angle | ) | const |
bool ignition::math::Angle::operator== | ( | const Angle & | _angle | ) | const |
Equality operator, result = this == _angle.
[in] | _angle | Angle to check for equality |
bool ignition::math::Angle::operator> | ( | const Angle & | _angle | ) | const |
bool ignition::math::Angle::operator>= | ( | const Angle & | _angle | ) | const |
void ignition::math::Angle::Radian | ( | double | _radian | ) |
Set the value from an angle in radians.
[in] | _radian | Radian value |
double ignition::math::Angle::Radian | ( | ) | const |
Get the angle in radians.
|
friend |
Stream insertion operator.
Outputs in degrees
[in] | _out | output stream |
[in] | _a | angle to output |
|
friend |
Stream extraction operator.
Assumes input is in radians
in | input stream |
pt | angle to read value into |
|
static |
math::Angle(IGN_PI * 0.5)
|
static |
math::Angle(IGN_PI)
|
static |
math::Angle(IGN_PI * 2)
|
static |
math::Angle(0)