17 #ifndef GAZEBO_MATH_ANGLE_HH_
18 #define GAZEBO_MATH_ANGLE_HH_
21 #include <ignition/math/Angle.hh>
28 #define GZ_RTOD(r) gazebo::math::Angle::RadiansToDegrees(r)
33 #define GZ_DTOR(d) gazebo::math::Angle::DegreesToRadians(d)
38 #define GZ_NORMALIZE(a) gazebo::math::Angle::Normalize(a)
76 public:
Angle(const
Angle &_angle) GAZEBO_DEPRECATED(8.0);
80 public:
Angle(const ignition::math::
Angle &_angle) GAZEBO_DEPRECATED(8.0);
83 public: virtual ~
Angle();
87 public:
void SetFromRadian(
double _radian);
91 public:
void SetFromDegree(
double _degree);
95 public:
double Radian() const;
99 public:
double Degree() const;
102 public:
void Normalize();
106 public: inline
double operator*()
const {
return value; }
110 public:
Angle operator-(
const Angle &_angle)
const;
115 public:
Angle operator+(
const Angle &_angle)
const;
120 public:
Angle operator*(
const Angle &_angle)
const;
125 public:
Angle operator/(
const Angle &_angle)
const;
130 public:
Angle operator-=(
const Angle &_angle);
135 public:
Angle operator+=(
const Angle &_angle);
140 public:
Angle operator*=(
const Angle &_angle);
145 public:
Angle operator/=(
const Angle &_angle);
149 public: ignition::math::Angle Ign()
const;
154 public:
Angle &operator=(
const double &_angle);
159 public:
Angle &operator=(
const ignition::math::Angle &_angle);
164 public:
bool operator ==(
const Angle &_angle)
const;
169 public:
bool operator!=(
const Angle &_angle)
const;
174 public:
bool operator<(
const Angle &_angle)
const;
179 public:
bool operator<=(
const Angle &_angle)
const;
184 public:
bool operator>(
const Angle &_angle)
const;
189 public:
bool operator>=(
const Angle &_angle)
const;
208 return _d * M_PI / 180;
217 return _r * 180 / M_PI;
226 return atan2(sin(_a), cos(_a));
237 _in.setf(std::ios_base::skipws);
243 private:
double value;
friend std::ostream & operator<<(std::ostream &_out, const gazebo::math::Angle &_a)
Stream insertion operator.
Definition: Angle.hh:195
static const Angle HalfPi
math::Angle(M_PI * 0.5)
Definition: Angle.hh:62
static double DegreesToRadians(const double _d) GAZEBO_DEPRECATED(8.0)
Converts degrees to radians.
Definition: Angle.hh:205
friend std::istream & operator>>(std::istream &_in, gazebo::math::Angle &_a)
Stream extraction operator.
Definition: Angle.hh:233
static const double GAZEBO_DEPRECATED(8.0) MAX_D
Double maximum value. This value will be similar to 1.79769e+308.
Definition: Helpers.hh:140
static const Angle TwoPi
math::Angle(M_PI * 2)
Definition: Angle.hh:65
double Radian() const
Get the angle in radians.
static const Angle Pi
math::Angle(M_PI)
Definition: Angle.hh:59
static double Normalize(const double _a) GAZEBO_DEPRECATED(8.0)
Macro that normalizes an angle in the range -Pi to Pi.
Definition: Angle.hh:223
static double RadiansToDegrees(const double _r) GAZEBO_DEPRECATED(8.0)
Converts radians to degrees.
Definition: Angle.hh:214
An angle and related functions.
Definition: Angle.hh:53
static const Angle Zero
math::Angle(0)
Definition: Angle.hh:56