17 #ifndef IGNITION_MATH_ANGLE_HH_ 18 #define IGNITION_MATH_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))) 64 public:
Angle(
const double _radian);
71 public:
virtual ~
Angle();
75 public:
void Radian(
double _radian);
79 public:
void Degree(
double _degree);
83 public:
double Radian()
const;
87 public:
double Degree()
const;
90 public:
void Normalize();
94 public:
double operator()()
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)
const;
126 public:
Angle operator-=(
const Angle &_angle);
131 public:
Angle operator+=(
const Angle &_angle);
136 public:
Angle operator*=(
const Angle &_angle);
141 public:
Angle operator/=(
const Angle &_angle);
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;
171 public:
bool operator>=(
const Angle &_angle)
const;
192 _in.setf(std::ios_base::skipws);
198 private:
double value;
An angle and related functions.
Definition: Angle.hh:44
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:177
double operator*() const
Dereference operator.
Definition: Angle.hh:98
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.
#define IGNITION_VISIBLE
Use to represent "symbol visible" if supported.
Definition: System.hh:59
friend std::istream & operator>>(std::istream &_in, ignition::math::Angle &_a)
Stream extraction operator.
Definition: Angle.hh:188
static const Angle Pi
math::Angle(IGN_PI)
Definition: Angle.hh:50