It defines the basic type CRadians, used to store an angle value in radians. More...

#include <angles.h>

Collaboration diagram for argos::CRadians:

Public Member Functions

 CRadians ()
 Class constructor It initializes m_fValue to 0 radians. More...
 
 CRadians (Real f_value)
 Class constructor It initializes m_fValue to the passed value. More...
 
void FromValueInDegrees (Real f_value)
 Sets the value from a value in degrees It sets m_fValue (which is in radians) converting from the passed value in degrees. More...
 
Real GetValue () const
 Returns the value in radians. More...
 
Real GetAbsoluteValue () const
 Returns the absolute value in radians. More...
 
void SetValue (Real f_value)
 Sets the value in radians. More...
 
CRadiansSignedNormalize ()
 Normalizes the value in the range [-PI:PI]. More...
 
CRadiansUnsignedNormalize ()
 Normalizes the value in the range [0:TWO_PI]. More...
 
CRadiansNegate ()
 
CRadiansoperator+ ()
 
CRadians operator- () const
 
CRadiansoperator+= (const CRadians &c_radians)
 
CRadiansoperator-= (const CRadians &c_radians)
 
CRadiansoperator*= (Real f_value)
 
CRadiansoperator/= (Real f_value)
 
CRadians operator+ (const CRadians &c_radians) const
 
CRadians operator- (const CRadians &c_radians) const
 
CRadians operator* (Real f_value) const
 
Real operator/ (const CRadians &c_radians) const
 
CRadians operator/ (Real f_value) const
 
bool operator< (const CRadians &c_radians) const
 
bool operator<= (const CRadians &c_radians) const
 
bool operator> (const CRadians &c_radians) const
 
bool operator>= (const CRadians &c_radians) const
 
bool operator== (const CRadians &c_radians) const
 
bool operator!= (const CRadians &c_radians) const
 

Static Public Attributes

static const CRadians PI
 The PI constant. More...
 
static const CRadians TWO_PI
 Set to PI * 2. More...
 
static const CRadians PI_OVER_TWO
 Set to PI / 2. More...
 
static const CRadians PI_OVER_THREE
 Set to PI / 3. More...
 
static const CRadians PI_OVER_FOUR
 Set to PI / 4. More...
 
static const CRadians PI_OVER_SIX
 Set to PI / 6. More...
 
static const CRadians ZERO
 Set to zero radians. More...
 
static const CRange< CRadiansSIGNED_RANGE
 The signed normalization range [-PI:PI]. More...
 
static const CRange< CRadiansUNSIGNED_RANGE
 The unsigned normalization range [0:TWO_PI]. More...
 
static const Real RADIANS_TO_DEGREES
 Constant to convert from radians to degrees. More...
 

Friends

CRadians operator* (Real f_value, const CRadians &c_radians)
 
CDegrees ToDegrees (const CRadians &c_radians)
 Converts this object to CDegrees. More...
 
CRadians NormalizedDifference (const CRadians &c_rad1, const CRadians &c_rad2)
 Calculates the normalized difference between the given angles. More...
 
std::ostream & operator<< (std::ostream &c_os, const CRadians &c_radians)
 
std::istream & operator>> (std::istream &is, CRadians &c_radians)
 

Detailed Description

It defines the basic type CRadians, used to store an angle value in radians.

Definition at line 42 of file angles.h.

Constructor & Destructor Documentation

argos::CRadians::CRadians ( )
inline

Class constructor It initializes m_fValue to 0 radians.

Definition at line 85 of file angles.h.

argos::CRadians::CRadians ( Real  f_value)
inlineexplicit

Class constructor It initializes m_fValue to the passed value.

Parameters
f_valuethe wanted value in radians

Definition at line 94 of file angles.h.

Member Function Documentation

void argos::CRadians::FromValueInDegrees ( Real  f_value)
inline

Sets the value from a value in degrees It sets m_fValue (which is in radians) converting from the passed value in degrees.

Parameters
f_valuea value in degrees

Definition at line 103 of file angles.h.

Real argos::CRadians::GetAbsoluteValue ( ) const
inline

Returns the absolute value in radians.

Returns
the absolute value in radians

Definition at line 119 of file angles.h.

Real argos::CRadians::GetValue ( ) const
inline

Returns the value in radians.

Returns
the value in radians

Definition at line 111 of file angles.h.

CRadians& argos::CRadians::Negate ( )
inline

Definition at line 153 of file angles.h.

bool argos::CRadians::operator!= ( const CRadians c_radians) const
inline

Definition at line 241 of file angles.h.

CRadians argos::CRadians::operator* ( Real  f_value) const
inline

Definition at line 198 of file angles.h.

CRadians& argos::CRadians::operator*= ( Real  f_value)
inline

Definition at line 176 of file angles.h.

CRadians& argos::CRadians::operator+ ( )
inline

Definition at line 158 of file angles.h.

CRadians argos::CRadians::operator+ ( const CRadians c_radians) const
inline

Definition at line 186 of file angles.h.

CRadians& argos::CRadians::operator+= ( const CRadians c_radians)
inline

Definition at line 166 of file angles.h.

CRadians argos::CRadians::operator- ( ) const
inline

Definition at line 162 of file angles.h.

CRadians argos::CRadians::operator- ( const CRadians c_radians) const
inline

Definition at line 192 of file angles.h.

CRadians& argos::CRadians::operator-= ( const CRadians c_radians)
inline

Definition at line 171 of file angles.h.

Real argos::CRadians::operator/ ( const CRadians c_radians) const
inline

Definition at line 211 of file angles.h.

CRadians argos::CRadians::operator/ ( Real  f_value) const
inline

Definition at line 215 of file angles.h.

CRadians& argos::CRadians::operator/= ( Real  f_value)
inline

Definition at line 181 of file angles.h.

bool argos::CRadians::operator< ( const CRadians c_radians) const
inline

Definition at line 221 of file angles.h.

bool argos::CRadians::operator<= ( const CRadians c_radians) const
inline

Definition at line 225 of file angles.h.

bool argos::CRadians::operator== ( const CRadians c_radians) const
inline

Definition at line 237 of file angles.h.

bool argos::CRadians::operator> ( const CRadians c_radians) const
inline

Definition at line 229 of file angles.h.

bool argos::CRadians::operator>= ( const CRadians c_radians) const
inline

Definition at line 233 of file angles.h.

void argos::CRadians::SetValue ( Real  f_value)
inline

Sets the value in radians.

Parameters
f_valuethe wanted value in radians

Definition at line 127 of file angles.h.

CRadians& argos::CRadians::SignedNormalize ( )
inline

Normalizes the value in the range [-PI:PI].

Returns
A reference to the current object
See also
CRadians::PI
CRange

Definition at line 137 of file angles.h.

CRadians& argos::CRadians::UnsignedNormalize ( )
inline

Normalizes the value in the range [0:TWO_PI].

Returns
A reference to the current object
See also
CRadians::TWO_PI
CRange

Definition at line 148 of file angles.h.

Friends And Related Function Documentation

CRadians NormalizedDifference ( const CRadians c_rad1,
const CRadians c_rad2 
)
friend

Calculates the normalized difference between the given angles.

The difference is calculated as c_angle1 - c_angle2 and normalized in the range [-pi,pi].

Parameters
c_angle1The first angle
c_angle2The second angle
Returns
The smallest difference between the two angles

Definition at line 510 of file angles.h.

CRadians operator* ( Real  f_value,
const CRadians c_radians 
)
friend

Definition at line 204 of file angles.h.

std::ostream& operator<< ( std::ostream &  c_os,
const CRadians c_radians 
)
friend

Definition at line 254 of file angles.h.

std::istream& operator>> ( std::istream &  is,
CRadians c_radians 
)
friend

Definition at line 265 of file angles.h.

CDegrees ToDegrees ( const CRadians c_radians)
friend

Converts this object to CDegrees.

Returns
the conversion of m_fValue into CDegrees
Parameters
c_radiansthe object to convert
Returns
the converted CDegrees object

Definition at line 489 of file angles.h.

Member Data Documentation

const CRadians argos::CRadians::PI
static

The PI constant.

Definition at line 49 of file angles.h.

const CRadians argos::CRadians::PI_OVER_FOUR
static

Set to PI / 4.

Definition at line 69 of file angles.h.

const CRadians argos::CRadians::PI_OVER_SIX
static

Set to PI / 6.

Definition at line 74 of file angles.h.

const CRadians argos::CRadians::PI_OVER_THREE
static

Set to PI / 3.

Definition at line 64 of file angles.h.

const CRadians argos::CRadians::PI_OVER_TWO
static

Set to PI / 2.

Definition at line 59 of file angles.h.

const Real argos::CRadians::RADIANS_TO_DEGREES
static

Constant to convert from radians to degrees.

Definition at line 275 of file angles.h.

const CRange< CRadians > argos::CRadians::SIGNED_RANGE
static

The signed normalization range [-PI:PI].

Definition at line 273 of file angles.h.

const CRadians argos::CRadians::TWO_PI
static

Set to PI * 2.

Definition at line 54 of file angles.h.

const CRange< CRadians > argos::CRadians::UNSIGNED_RANGE
static

The unsigned normalization range [0:TWO_PI].

Definition at line 274 of file angles.h.

const CRadians argos::CRadians::ZERO
static

Set to zero radians.

Definition at line 79 of file angles.h.