Angle Class Reference

Embodiment of an angular value. More...

#include <Util/Angle.H>

List of all members.

Public Member Functions

Constructors, destructor, assigments, and conversions

 Angle (const double val=0.0)
 Constructor. Initial value should be in degrees.
 Angle (const Angle &ang)
 Copy constructor.
 ~Angle ()
 Destructor.
Angleoperator= (const Angle &ang)
 Assignment.
Angleoperator= (const double ang)
 Assignment.
void setVal (const double val)
 Set a new value in degrees.
double getVal () const
 Get current value in degrees in ]-180.0 .. 180.0].
void setRadians (const double val)
 Conversion from radians.
double getRadians () const
 Get value in radians (in [-pi .. pi]).
Arithmetic operators

Angleoperator+= (const Angle &other)
 Addition. Result is taken modulo 360 and remains in ]-180.0 .. 180.0].
Angleoperator-= (const Angle &other)
 Subtraction. Result is taken modulo 360 and remains in ]-180.0 .. 180.0].
Angleoperator*= (const double fac)
 Multiplication by a constant. Result remains in ]-180.0 .. 180.0].
Angleoperator/= (const double fac)
 Division by a constant. Result remains in ]-180.0 .. 180.0].
Angle operator+ (const Angle &other) const
 Addition of two angles. Result remains in ]-180.0 .. 180.0].
Angle operator- (const Angle &other) const
 Subtraction of two angles. Result remains in ]-180.0 .. 180.0].
void vectorAdd (const Angle &other, const double otherlen=1.0)
 Combine with another angle, in vector style.
bool operator< (const Angle &other) const
 Comparison. USE WITH CAUTION!
bool operator> (const Angle &other) const
 Comparison. USE WITH CAUTION!
bool operator!= (const Angle &other) const
 Comparison. USE WITH CAUTION!
bool operator< (const double other) const
 Comparison. USE WITH CAUTION!
bool operator> (const double other) const
 Comparison. USE WITH CAUTION!
bool operator!= (const double other) const
 Comparison. USE WITH CAUTION!

Detailed Description

Embodiment of an angular value.

This class provides functions to manipulate and do maths on angles. The internal representation is a double value in degrees in the range ]-180.0 .. 180.0]. This is an all-inlined class, so there is no Angle.C file.

Definition at line 49 of file Angle.H.


Constructor & Destructor Documentation

Angle::Angle ( const double  val = 0.0  )  [inline]

Constructor. Initial value should be in degrees.

Definition at line 167 of file Angle.H.

Angle::Angle ( const Angle ang  )  [inline]

Copy constructor.

Definition at line 172 of file Angle.H.

Angle::~Angle (  )  [inline]

Destructor.

Definition at line 177 of file Angle.H.


Member Function Documentation

double Angle::getRadians (  )  const [inline]

Get value in radians (in [-pi .. pi]).

Definition at line 201 of file Angle.H.

Referenced by BeoSubOneBal::advanceRel(), and SeaBee::advanceRel().

double Angle::getVal (  )  const [inline]

Get current value in degrees in ]-180.0 .. 180.0].

Definition at line 193 of file Angle.H.

Referenced by main(), IMUListener::newData(), TestHMR3300Listener::newData(), TestBeoSubIMUListener::newData(), BeoSub::pitchAbs(), BeoSub::targetReached(), and BeoSub::turnAbs().

bool Angle::operator!= ( const double  other  )  const [inline]

Comparison. USE WITH CAUTION!

Definition at line 262 of file Angle.H.

bool Angle::operator!= ( const Angle other  )  const [inline]

Comparison. USE WITH CAUTION!

Definition at line 250 of file Angle.H.

Angle & Angle::operator*= ( const double  fac  )  [inline]

Multiplication by a constant. Result remains in ]-180.0 .. 180.0].

Definition at line 213 of file Angle.H.

Angle Angle::operator+ ( const Angle other  )  const [inline]

Addition of two angles. Result remains in ]-180.0 .. 180.0].

Definition at line 221 of file Angle.H.

Angle & Angle::operator+= ( const Angle other  )  [inline]

Addition. Result is taken modulo 360 and remains in ]-180.0 .. 180.0].

Definition at line 205 of file Angle.H.

Angle Angle::operator- ( const Angle other  )  const [inline]

Subtraction of two angles. Result remains in ]-180.0 .. 180.0].

Definition at line 225 of file Angle.H.

Angle & Angle::operator-= ( const Angle other  )  [inline]

Subtraction. Result is taken modulo 360 and remains in ]-180.0 .. 180.0].

Definition at line 209 of file Angle.H.

Angle & Angle::operator/= ( const double  fac  )  [inline]

Division by a constant. Result remains in ]-180.0 .. 180.0].

Definition at line 217 of file Angle.H.

bool Angle::operator< ( const double  other  )  const [inline]

Comparison. USE WITH CAUTION!

Definition at line 254 of file Angle.H.

bool Angle::operator< ( const Angle other  )  const [inline]

Comparison. USE WITH CAUTION!

Definition at line 242 of file Angle.H.

Angle & Angle::operator= ( const double  ang  )  [inline]

Assignment.

Definition at line 185 of file Angle.H.

Angle & Angle::operator= ( const Angle ang  )  [inline]

Assignment.

Definition at line 181 of file Angle.H.

bool Angle::operator> ( const double  other  )  const [inline]

Comparison. USE WITH CAUTION!

Definition at line 258 of file Angle.H.

bool Angle::operator> ( const Angle other  )  const [inline]

Comparison. USE WITH CAUTION!

Definition at line 246 of file Angle.H.

void Angle::setRadians ( const double  val  )  [inline]

Conversion from radians.

Definition at line 197 of file Angle.H.

void Angle::setVal ( const double  val  )  [inline]

Set a new value in degrees.

Definition at line 189 of file Angle.H.

Referenced by BeoSubDB::initializeDatabase().

void Angle::vectorAdd ( const Angle other,
const double  otherlen = 1.0 
) [inline]

Combine with another angle, in vector style.

This computes the sum of a unit vector with our angle and a vector with other's angle and optionally a given length. The result is the angle of the combined vector. Special cases (e.g., other is the exact opposite of us) are handled like atan2() would.

Definition at line 229 of file Angle.H.


The documentation for this class was generated from the following file:
Generated on Sun May 8 08:43:06 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3