17 #ifndef _IGNITION_ANGLE_HH_
18 #define _IGNITION_ANGLE_HH_
26 #define IGN_RTOD(r) ((r) * 180 / IGN_PI)
31 #define IGN_DTOR(d) ((d) * IGN_PI / 180)
36 #define IGN_NORMALIZE(a) (atan2(sin(a), cos(a)))
63 public:
Angle(
double _radian);
70 public:
virtual ~
Angle();
74 public:
void Radian(
double _radian);
78 public:
void Degree(
double _degree);
82 public:
double Radian()
const;
86 public:
double Degree()
const;
89 public:
void Normalize();
101 public:
Angle operator-(
const Angle &_angle)
const;
106 public:
Angle operator+(
const Angle &_angle)
const;
111 public:
Angle operator*(
const Angle &_angle)
const;
116 public:
Angle operator/(
const Angle &_angle)
const;
121 public:
Angle operator-=(
const Angle &_angle);
126 public:
Angle operator+=(
const Angle &_angle);
131 public:
Angle operator*=(
const Angle &_angle);
136 public:
Angle operator/=(
const Angle &_angle);
141 public:
bool operator==(
const Angle &_angle)
const;
146 public:
bool operator!=(
const Angle &_angle)
const;
151 public:
bool operator<(
const Angle &_angle)
const;
156 public:
bool operator<=(
const Angle &_angle)
const;
161 public:
bool operator>(
const Angle &_angle)
const;
166 public:
bool operator>=(
const Angle &_angle)
const;
187 _in.setf(std::ios_base::skipws);
193 private:
double value;
An angle and related functions.
Definition: Angle.hh:44
#define IGNITION_VISIBLE
Use to represent "symbol visible" if supported.
Definition: Helpers.hh:346
static const Angle Zero
math::Angle(0)
Definition: Angle.hh:47
friend std::ostream & operator<<(std::ostream &_out, const ignition::math::Angle &_a)
Stream insertion operator.
Definition: Angle.hh:172
double operator*() const
Dereference operator.
Definition: Angle.hh:93
static const Angle TwoPi
math::Angle(IGN_PI * 2)
Definition: Angle.hh:56
static const Angle HalfPi
math::Angle(IGN_PI * 0.5)
Definition: Angle.hh:53
void Radian(double _radian)
Set the value from an angle in radians.
friend std::istream & operator>>(std::istream &_in, ignition::math::Angle &_a)
Stream extraction operator.
Definition: Angle.hh:183
static const Angle Pi
math::Angle(IGN_PI)
Definition: Angle.hh:50