Angle Class Reference

An angle and related functions. More...

`#include <math/gzmath.hh>`

## Public Member Functions

Angle () GAZEBO_DEPRECATED(8.0)
Constructor. More...

Angle (double _radian) GAZEBO_DEPRECATED(8.0)
Copy Constructor. More...

Angle (const Angle &_angle) GAZEBO_DEPRECATED(8.0)
Copy constructor. More...

Angle (const ignition::math::Angle &_angle) GAZEBO_DEPRECATED(8.0)
Ignition copy constructor. More...

virtual ~Angle ()
Destructor. More...

double Degree () const
Get the angle in degrees. More...

ignition::math::Angle Ign () const
Convert this angle to an ignition::math::Angle. More...

void Normalize ()
Normalize the angle in the range -Pi to Pi. More...

bool operator!= (const Angle &_angle) const
Inequality. More...

double operator* () const
Dereference operator. More...

Angle operator* (const Angle &_angle) const
Multiplication operator, result = this * _angle. More...

Angle operator*= (const Angle &_angle)
Multiplication set, this = this * _angle. More...

Angle operator+ (const Angle &_angle) const
Addition operator, result = this + _angle. More...

Angle operator+= (const Angle &_angle)
Addition set, this = this + _angle. More...

Angle operator- (const Angle &_angle) const
Substraction, result = this - _angle. More...

Angle operator-= (const Angle &_angle)
Subtraction set, this = this - _angle. More...

Angle operator/ (const Angle &_angle) const
Division, result = this / _angle. More...

Angle operator/= (const Angle &_angle)
Division set, this = this / _angle. More...

bool operator< (const Angle &_angle) const
Less than operator. More...

bool operator<= (const Angle &_angle) const
Less or equal operator. More...

Angleoperator= (const double &_angle)
Assignment operator. More...

Angleoperator= (const ignition::math::Angle &_angle)
Assignment operator. More...

bool operator== (const Angle &_angle) const
Equality operator, result = this == _angle. More...

bool operator> (const Angle &_angle) const
Greater than operator. More...

bool operator>= (const Angle &_angle) const
Greater or equal operator. More...

double Radian () const
Get the angle in radians. More...

void SetFromDegree (double _degree)
Set the value from an angle in degrees. More...

Set the value from an angle in radians. More...

## Static Public Member Functions

static double DegreesToRadians (const double _d) GAZEBO_DEPRECATED(8.0)
Converts degrees to radians. More...

static double Normalize (const double _a) GAZEBO_DEPRECATED(8.0)
Macro that normalizes an angle in the range -Pi to Pi. More...

static double RadiansToDegrees (const double _r) GAZEBO_DEPRECATED(8.0)
Converts radians to degrees. More...

## Static Public Attributes

static const Angle HalfPi
math::Angle(M_PI * 0.5) More...

static const Angle Pi
math::Angle(M_PI) More...

static const Angle TwoPi
math::Angle(M_PI * 2) More...

static const Angle Zero
math::Angle(0) More...

## Friends

std::ostream & operator<< (std::ostream &_out, const gazebo::math::Angle &_a)
Stream insertion operator. More...

std::istream & operator>> (std::istream &_in, gazebo::math::Angle &_a)
Stream extraction operator. More...

## Detailed Description

An angle and related functions.

## Constructor & Destructor Documentation

 Angle ( )

Constructor.

 Angle ( double _radian )

Copy Constructor.

Parameters
 Angle ( const Angle & _angle )

Copy constructor.

Parameters
 [in] _angle Angle to copy
 Angle ( const ignition::math::Angle & _angle )

Ignition copy constructor.

Parameters
 [in] _angle Ignition angle to copy
 virtual ~Angle ( )
virtual

Destructor.

## Member Function Documentation

 double Degree ( ) const

Get the angle in degrees.

Returns
double containing the angle's degree value
 static double DegreesToRadians ( const double _d )
inlinestatic

Converts degrees to radians.

Parameters
 [in] degrees
Returns
 ignition::math::Angle Ign ( ) const

Convert this angle to an ignition::math::Angle.

Returns
This Angle as an ignition::math::Angle.

Referenced by Angle::operator*().

 void Normalize ( )

Normalize the angle in the range -Pi to Pi.

 static double Normalize ( const double _a )
inlinestatic

Macro that normalizes an angle in the range -Pi to Pi.

Parameters
 [in] angle
Returns
the angle, in range
 bool operator!= ( const Angle & _angle ) const

Inequality.

Parameters
 [in] _angle Angle to check for inequality
Returns
true if this != _angle

Referenced by Angle::operator*().

 double operator* ( ) const
inline

Dereference operator.

Returns
Double containing the angle's radian value
 Angle operator* ( const Angle & _angle ) const

Multiplication operator, result = this * _angle.

Parameters
 [in] _angle Angle for multiplication
Returns
the new angle
 Angle operator*= ( const Angle & _angle )

Multiplication set, this = this * _angle.

Parameters
 [in] _angle Angle for multiplication
Returns
angle

Referenced by Angle::operator*().

 Angle operator+ ( const Angle & _angle ) const

Addition operator, result = this + _angle.

Parameters
 [in] _angle Angle for addition
Returns
the new angle

Referenced by Angle::operator*().

 Angle operator+= ( const Angle & _angle )

Addition set, this = this + _angle.

Parameters
 [in] _angle Angle for addition
Returns
angle

Referenced by Angle::operator*().

 Angle operator- ( const Angle & _angle ) const

Substraction, result = this - _angle.

Parameters
 [in] _angle Angle for substraction
Returns
the new angle

Referenced by Angle::operator*().

 Angle operator-= ( const Angle & _angle )

Subtraction set, this = this - _angle.

Parameters
 [in] _angle Angle for subtraction
Returns
angle

Referenced by Angle::operator*().

 Angle operator/ ( const Angle & _angle ) const

Division, result = this / _angle.

Parameters
 [in] _angle Angle for division
Returns
the new angle

Referenced by Angle::operator*().

 Angle operator/= ( const Angle & _angle )

Division set, this = this / _angle.

Parameters
 [in] _angle Angle for division
Returns
angle

Referenced by Angle::operator*().

 bool operator< ( const Angle & _angle ) const

Less than operator.

Parameters
 [in] _angle Angle to check
Returns
true if this < _angle

Referenced by Angle::operator*().

 bool operator<= ( const Angle & _angle ) const

Less or equal operator.

Parameters
 [in] _angle Angle to check
Returns
true if this <= _angle

Referenced by Angle::operator*().

 Angle& operator= ( const double & _angle )

Assignment operator.

Parameters
Returns
The new angle

Referenced by Angle::operator*().

 Angle& operator= ( const ignition::math::Angle & _angle )

Assignment operator.

Parameters
 [in] _angle ignition::math::Angle to copy
Returns
The new angle
 bool operator== ( const Angle & _angle ) const

Equality operator, result = this == _angle.

Parameters
 [in] _angle Angle to check for equality
Returns
true if this == _angle

Referenced by Angle::operator*().

 bool operator> ( const Angle & _angle ) const

Greater than operator.

Parameters
 [in] _angle Angle to check
Returns
true if this > _angle

Referenced by Angle::operator*().

 bool operator>= ( const Angle & _angle ) const

Greater or equal operator.

Parameters
 [in] _angle Angle to check
Returns
true if this >= _angle

Referenced by Angle::operator*().

 double Radian ( ) const

Get the angle in radians.

Returns
double containing the angle's radian value
 static double RadiansToDegrees ( const double _r )
inlinestatic

Converts radians to degrees.

Parameters
Returns
degrees
 void SetFromDegree ( double _degree )

Set the value from an angle in degrees.

Parameters
 [in] _degree Degree value

Set the value from an angle in radians.

Parameters

## Friends And Related Function Documentation

 std::ostream& operator<< ( std::ostream & _out, const gazebo::math::Angle & _a )
friend

Stream insertion operator.

Outputs in degrees

Parameters
 [in] _out output stream [in] _a angle to output
Returns
The output stream
 std::istream& operator>> ( std::istream & _in, gazebo::math::Angle & _a )
friend

Stream extraction operator.

Assumes input is in degrees

Parameters
 in input stream pt angle to read value into
Returns
The input stream

## Member Data Documentation

 const Angle HalfPi
static

math::Angle(M_PI * 0.5)

 const Angle Pi
static

math::Angle(M_PI)

 const Angle TwoPi
static

math::Angle(M_PI * 2)

 const Angle Zero
static

math::Angle(0)

The documentation for this class was generated from the following file: