Angle Class Reference
[Spaces]

Represents angles. More...

#include <S1.h>

List of all members.

Public Member Functions

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


Detailed Description

Represents angles.

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

exampleCommModule.cpp.


Constructor & Destructor Documentation

Angle::Angle (  )  [inline]

Default constructor.

Angle::Angle ( const Decimal t  )  [inline]

Decimal constructor.

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

Copy constructor.


Member Function Documentation

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

Assigment operator =.

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

Compound assignment operator +=.

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

Compound assignment operator -=.

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

Compound assignment operator *=.

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

Compound assignment operator *= with scalar.

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

Binary arithmetic operator +.

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

Binary arithmetic operator -.

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

Binary arithmetic operator *.

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

Binary arithmetic operator * with scalar.

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

Compound operator ==.

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

Compound operator !=.

Decimal Angle::dCast (  )  const [inline]

Explicit casting to Decimal [0, 2*M_PI].

Decimal Angle::dCast2Pi (  )  const [inline]

Explicit casting to Decimal [0, 2*M_PI].

Decimal Angle::dCastPi ( int  opt = 0  )  const [inline]

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

Decimal Angle::dCastDeg (  )  const [inline]

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

UCoordmm Angle::dCastHDeg (  )  const [inline]

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

Decimal Angle::alDiff ( const Angle other  )  const

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

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

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

Decimal Angle::ccwDiff ( const Angle other  )  const

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 Angle::cwDiff ( const Angle other  )  const

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 Angle::almostEqual ( const Angle A,
const Decimal toll 
) const

Equal condition with a tollerance.

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

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

The same as ccwMean but weighted.

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

Angle Angle::ccwMean ( const Angle other  )  const

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].

Angle Angle::cwMean ( const Angle other  )  const

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 Angle::print ( int  precision = 2  )  const

Print function.

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


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

Generated on Mon Feb 20 07:01:09 2017 for MIP by  doxygen 1.5.6