Ang2Pi Class Reference
[Spaces]

Represents angles in [0,2*PI). More...

#include <S1.h>

List of all members.

Public Member Functions

 Ang2Pi ()
 Default constructor.
 Ang2Pi (Decimal t)
 Decimal constructor.
 Ang2Pi (const Ang2Pi &rhs)
 Copy constructor.
Ang2Pioperator= (const Ang2Pi &rhs)
 Assigment operator =.
Ang2Pioperator+= (const Ang2Pi &a)
 Compound assignment operator +=.
Ang2Pioperator-= (const Ang2Pi &other)
 Compound assignment operator -=.
Ang2Pioperator*= (const Ang2Pi &a)
 Compound assignment operator *=.
Ang2Pioperator*= (const Decimal &d)
 Compound assignment operator *= with scalar.
const Ang2Pi operator+ (const Ang2Pi &other) const
 Binary arithmetic operator +.
const Ang2Pi operator- (const Ang2Pi &other) const
 Binary arithmetic operator -.
const Ang2Pi operator* (const Ang2Pi &other) const
 Binary arithmetic operator *.
const Ang2Pi operator* (const Decimal &d) const
 Binary arithmetic operator * with scalar.
bool operator== (const Ang2Pi &other) const
 Compound operator ==.
bool operator!= (const Ang2Pi &other) const
 Compound operator !=.
Decimal dCast () const
 Explicit casting to Decimal.
Decimal dCastPi ()
 Explicit casting to Decimal in (-M_PI, M_PI].
Decimal dCastDeg ()
 Explicit casting to Decimal, in degrees [0, 360.0).
UCoordmm dCastHDeg ()
 Explicit casting to UCoordmm, in hundredths of degrees [0, 36000).
Decimal alDiff (const Ang2Pi &other)
 Algebric difference (in ]-PI,PI]).
Decimal ccwDiff (const Ang2Pi &other)
 Counter-clock-wise difference (in [0,2*PI[).
Decimal cwDiff (const Ang2Pi &other)
 Clock-wise difference (in ]-2*PI,0]).
bool almostEqual (Ang2Pi A, Decimal toll)
 Equal condition with a tollerance.
Ang2Pi nearestMean (const Ang2Pi &other, Decimal w1=0.5)
 The same as ccwMean but weighted.
Ang2Pi ccwMean (const Ang2Pi &other)
 Counter-clock-wise mean, i.e, mean angle in ]this, other].
Ang2Pi cwMean (const Ang2Pi &other)
 Clock-wise mean, i.e, mean angle in ]other, this].
string print (int precision=2)
 Print function.

Friends

class boost::serialization::access


Detailed Description

Represents angles in [0,2*PI).

Author:
Antonio Franchi
Todo:
make this a derived class of S1
Examples:

exampleCommModule.cpp.


Constructor & Destructor Documentation

Ang2Pi::Ang2Pi (  )  [inline]

Default constructor.

Ang2Pi::Ang2Pi ( Decimal  t  )  [inline]

Decimal constructor.

Ang2Pi::Ang2Pi ( const Ang2Pi rhs  )  [inline]

Copy constructor.


Member Function Documentation

Ang2Pi& Ang2Pi::operator= ( const Ang2Pi rhs  )  [inline]

Assigment operator =.

Ang2Pi& Ang2Pi::operator+= ( const Ang2Pi a  )  [inline]

Compound assignment operator +=.

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

Compound assignment operator -=.

Ang2Pi& Ang2Pi::operator*= ( const Ang2Pi a  )  [inline]

Compound assignment operator *=.

Ang2Pi& Ang2Pi::operator*= ( const Decimal d  )  [inline]

Compound assignment operator *= with scalar.

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

Binary arithmetic operator +.

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

Binary arithmetic operator -.

const Ang2Pi Ang2Pi::operator* ( const Ang2Pi other  )  const [inline]

Binary arithmetic operator *.

const Ang2Pi Ang2Pi::operator* ( const Decimal d  )  const [inline]

Binary arithmetic operator * with scalar.

bool Ang2Pi::operator== ( const Ang2Pi other  )  const [inline]

Compound operator ==.

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

Compound operator !=.

Decimal Ang2Pi::dCast (  )  const [inline]

Explicit casting to Decimal.

Decimal Ang2Pi::dCastPi (  )  [inline]

Explicit casting to Decimal in (-M_PI, M_PI].

Decimal Ang2Pi::dCastDeg (  )  [inline]

Explicit casting to Decimal, in degrees [0, 360.0).

UCoordmm Ang2Pi::dCastHDeg (  )  [inline]

Explicit casting to UCoordmm, in hundredths of degrees [0, 36000).

Decimal Ang2Pi::alDiff ( const Ang2Pi other  ) 

Algebric difference (in ]-PI,PI]).

i.e, other - this in [0,2*PI[.

Parameters:
[in] other The Ang2Pi respect to it is computed the algebric distance.
Returns:
The algebric distance respect to an angle, it is in [-PI,PI].

Decimal Ang2Pi::ccwDiff ( const Ang2Pi other  ) 

Counter-clock-wise difference (in [0,2*PI[).

i.e, other - this in in [0,2*PI[.

Parameters:
[in] other The other angle.
Returns:
A Decimal in [0,2*PI[.

Decimal Ang2Pi::cwDiff ( const Ang2Pi other  ) 

Clock-wise difference (in ]-2*PI,0]).

i.e, other - this in in ]-2*PI,0].

Parameters:
other The other angle.
Returns:
A Decimal in ]-2*PI,0].

bool Ang2Pi::almostEqual ( Ang2Pi  A,
Decimal  toll 
)

Equal condition with a tollerance.

Parameters:
[in] A The Ang2Pi to be confronted with.
[in] toll The acceppted tollerance (rad).
Returns:
true if difference betwen Ang2Pi is less than the tollerance, false otherwise.

Ang2Pi Ang2Pi::nearestMean ( const Ang2Pi other,
Decimal  w1 = 0.5 
)

The same as ccwMean but weighted.

Parameters:
[in] &other The Ang2Pi respect to it is computed the weigthed ccwMean.
[in] w1 Weight of the this Ang2Pi. The weight of other is given as 1-w1.
Note:
w1 must be in [0,1].
Returns:
An angle that is the weighted mean.

Ang2Pi Ang2Pi::ccwMean ( const Ang2Pi other  ) 

Counter-clock-wise mean, i.e, mean angle in ]this, other].

If this == other, it is by definition this + M_PI.

Parameters:
[in] other The other angle.
Returns:
Mean angle in ]this, other].

Ang2Pi Ang2Pi::cwMean ( const Ang2Pi other  ) 

Clock-wise mean, i.e, mean angle in ]other, this].

if this == other, it is by definition this.

Parameters:
[in] other The other angle.
Returns:
Mean angle in ]other, this].

string Ang2Pi::print ( int  precision = 2  ) 

Print function.

Parameters:
[in] precision The number of decimals (default is 2).
Returns:
A printable string with the value printed on it.


Friends And Related Function Documentation

friend class boost::serialization::access [friend]


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

Generated on Sat Jul 3 07:01:05 2010 for MIP by  doxygen 1.5.6