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);
74 public:
virtual ~
Angle();
78 public:
void Radian(
double _radian);
82 public:
void Degree(
double _degree);
86 public:
double Radian()
const;
90 public:
double Degree()
const;
93 public:
void Normalize();
97 public:
double operator()()
const;
109 public:
Angle operator-(
const Angle &_angle)
const;
114 public:
Angle operator+(
const Angle &_angle)
const;
119 public:
Angle operator*(
const Angle &_angle)
const;
124 public:
Angle operator/(
const Angle &_angle)
const;
129 public:
Angle operator-=(
const Angle &_angle);
134 public:
Angle operator+=(
const Angle &_angle);
139 public:
Angle operator*=(
const Angle &_angle);
144 public:
Angle operator/=(
const Angle &_angle);
149 public:
bool operator==(
const Angle &_angle)
const;
154 public:
bool operator!=(
const Angle &_angle)
const;
159 public:
bool operator<(
const Angle &_angle)
const;
164 public:
bool operator<=(
const Angle &_angle)
const;
169 public:
bool operator>(
const Angle &_angle)
const;
174 public:
bool operator>=(
const Angle &_angle)
const;
181 const ignition::math::Angle &_a)
192 ignition::math::Angle &_a)
195 _in.setf(std::ios_base::skipws);
201 private:
double value;
static const Angle TwoPi
math::Angle(IGN_PI * 2)
Definition: Angle.hh:59
static const Angle HalfPi
math::Angle(IGN_PI * 0.5)
Definition: Angle.hh:56
friend std::ostream & operator<<(std::ostream &_out, const ignition::math::Angle &_a)
Stream insertion operator.
Definition: Angle.hh:180
An angle and related functions.
Definition: Angle.hh:47
friend std::istream & operator>>(std::istream &_in, ignition::math::Angle &_a)
Stream extraction operator.
Definition: Angle.hh:191
static const Angle Zero
math::Angle(0)
Definition: Angle.hh:50
double operator*() const
Dereference operator.
Definition: Angle.hh:101
static const Angle Pi
math::Angle(IGN_PI)
Definition: Angle.hh:53