17#ifndef IGNITION_MATH_ANGLE_HH_
18#define IGNITION_MATH_ANGLE_HH_
22#include <ignition/math/config.hh>
27#define IGN_RTOD(r) ((r) * 180 / IGN_PI)
32#define IGN_DTOR(d) ((d) * IGN_PI / 180)
37#define IGN_NORMALIZE(a) (atan2(sin(a), cos(a)))
43 inline namespace IGNITION_MATH_VERSION_NAMESPACE
47 class IGNITION_MATH_VISIBLE
Angle
67 public:
Angle(
const double _radian);
195 _in.setf(std::ios_base::skipws);
201 private:
double value;
An angle and related functions.
Definition Angle.hh:48
bool operator>(const Angle &_angle) const
Greater than operator.
friend std::ostream & operator<<(std::ostream &_out, const ignition::math::Angle &_a)
Stream insertion operator.
Definition Angle.hh:180
Angle operator-(const Angle &_angle) const
Substraction, result = this - _angle.
static const Angle Zero
math::Angle(0)
Definition Angle.hh:50
Angle(const double _radian)
Conversion Constructor.
static const Angle TwoPi
math::Angle(IGN_PI * 2)
Definition Angle.hh:59
void Normalize()
Normalize the angle in the range -Pi to Pi.
friend std::istream & operator>>(std::istream &_in, ignition::math::Angle &_a)
Stream extraction operator.
Definition Angle.hh:191
static const Angle Pi
math::Angle(IGN_PI)
Definition Angle.hh:53
bool operator<(const Angle &_angle) const
Less than operator.
void Degree(double _degree)
Set the value from an angle in degrees.
bool operator==(const Angle &_angle) const
Equality operator, result = this == _angle.
double Degree() const
Get the angle in degrees.
bool operator!=(const Angle &_angle) const
Inequality.
Angle operator*(const Angle &_angle) const
Multiplication operator, result = this * _angle.
Angle(const Angle &_angle)
Copy constructor.
static const Angle HalfPi
math::Angle(IGN_PI * 0.5)
Definition Angle.hh:56
Angle operator*=(const Angle &_angle)
Multiplication set, this = this * _angle.
bool operator>=(const Angle &_angle) const
Greater or equal operator.
Angle operator+(const Angle &_angle) const
Addition operator, result = this + _angle.
Angle operator+=(const Angle &_angle)
Addition set, this = this + _angle.
Angle operator/(const Angle &_angle) const
Division, result = this / _angle.
bool operator<=(const Angle &_angle) const
Less or equal operator.
double operator*() const
Dereference operator.
Definition Angle.hh:101
Angle operator-=(const Angle &_angle)
Subtraction set, this = this - _angle.
virtual ~Angle()
Destructor.
double Radian() const
Get the angle in radians.
void Radian(double _radian)
Set the value from an angle in radians.
Angle operator/=(const Angle &_angle)
Division set, this = this / _angle.
double operator()() const
Return the angle's radian value.