INET Framework for OMNeT++/OMNEST
inet::EulerAngles Class Reference

Orientations are represented by 3D double precision Tait-Bryan (Euler) tuples called EulerAngles. More...

#include <EulerAngles.h>

Public Member Functions

 EulerAngles ()
 
 EulerAngles (rad alpha, rad beta, rad gamma)
 
rad getAlpha () const
 
void setAlpha (rad alpha)
 
rad getBeta () const
 
void setBeta (rad beta)
 
rad getGamma () const
 
void setGamma (rad gamma)
 
std::string str () const
 
bool isNil () const
 
bool isUnspecified () const
 
EulerAnglesnormalize ()
 
EulerAngles operator+ (const EulerAngles a) const
 
EulerAngles operator- (const EulerAngles a) const
 
EulerAngles operator* (double f) const
 

Public Attributes

rad alpha
 
rad beta
 
rad gamma
 

Static Public Attributes

static const EulerAngles ZERO = EulerAngles(rad(0.0), rad(0.0), rad(0.0))
 
static const EulerAngles NIL = EulerAngles(rad(NaN), rad(NaN), rad(NaN))
 

Private Member Functions

void copy (const EulerAngles &other)
 

Detailed Description

Orientations are represented by 3D double precision Tait-Bryan (Euler) tuples called EulerAngles.

The angles are in Z, Y', X" order that is often called intrinsic rotations, they are measured in radians. The default (unrotated) orientation is along the X axis. Conceptually, the Z axis rotation is heading, the Y' axis rotation is descending (negative elevation), the X" axis rotation is bank. For example, positive rotation along the Z axis rotates X into Y (turns left), positive rotation along the Y axis rotates Z into X (leans forward), positive rotation along the X axis rotates Y into Z (leans right).

Constructor & Destructor Documentation

◆ EulerAngles() [1/2]

inet::EulerAngles::EulerAngles ( )
inline
39  : alpha(0.0), beta(0.0), gamma(0.0) {}

◆ EulerAngles() [2/2]

inet::EulerAngles::EulerAngles ( rad  alpha,
rad  beta,
rad  gamma 
)
inline
42  : alpha(alpha), beta(beta), gamma(gamma) {}

Member Function Documentation

◆ copy()

void inet::EulerAngles::copy ( const EulerAngles other)
inlineprivate
35 { alpha = other.alpha; beta = other.beta; gamma = other.gamma; }

◆ getAlpha()

rad inet::EulerAngles::getAlpha ( ) const
inline
44 { return alpha; }

◆ getBeta()

rad inet::EulerAngles::getBeta ( ) const
inline
47 { return beta; }

◆ getGamma()

rad inet::EulerAngles::getGamma ( ) const
inline
50 { return gamma; }

◆ isNil()

bool inet::EulerAngles::isNil ( ) const
inline
56  {
57  return this == &NIL;
58  }

◆ isUnspecified()

bool inet::EulerAngles::isUnspecified ( ) const
inline
61  {
62  return std::isnan(alpha.get()) && std::isnan(beta.get()) && std::isnan(gamma.get());
63  }

◆ normalize()

EulerAngles& inet::EulerAngles::normalize ( )
inline

◆ operator*()

EulerAngles inet::EulerAngles::operator* ( double  f) const
inline
77 { return EulerAngles(alpha * f, beta * f, gamma * f); }

◆ operator+()

EulerAngles inet::EulerAngles::operator+ ( const EulerAngles  a) const
inline
73 { return EulerAngles(alpha + a.alpha, beta + a.beta, gamma + a.gamma); }

◆ operator-()

EulerAngles inet::EulerAngles::operator- ( const EulerAngles  a) const
inline
75 { return EulerAngles(alpha - a.alpha, beta - a.beta, gamma - a.gamma); }

◆ setAlpha()

void inet::EulerAngles::setAlpha ( rad  alpha)
inline
45 { this->alpha = alpha; }

◆ setBeta()

void inet::EulerAngles::setBeta ( rad  beta)
inline
48 { this->beta = beta; }

◆ setGamma()

void inet::EulerAngles::setGamma ( rad  gamma)
inline
51 { this->gamma = gamma; }

◆ str()

std::string inet::EulerAngles::str ( ) const
inline
86 {
87  std::stringstream os;
88  os << *this;
89  return os.str();
90 }

Member Data Documentation

◆ alpha

◆ beta

◆ gamma

◆ NIL

const EulerAngles inet::EulerAngles::NIL = EulerAngles(rad(NaN), rad(NaN), rad(NaN))
static

◆ ZERO

const EulerAngles inet::EulerAngles::ZERO = EulerAngles(rad(0.0), rad(0.0), rad(0.0))
static

The documentation for this class was generated from the following files:
inet::EulerAngles::alpha
rad alpha
Definition: EulerAngles.h:30
inet::EulerAngles::beta
rad beta
Definition: EulerAngles.h:31
inet::EulerAngles::EulerAngles
EulerAngles()
Definition: EulerAngles.h:38
inet::math::modulo
double modulo(double a, double n)
Returns the remainder r on division of dividend a by divisor n, using floored division.
Definition: INETMath.h:116
inet::EulerAngles::NIL
static const EulerAngles NIL
Definition: EulerAngles.h:26
inet::units::value::get
const value_type & get() const
Definition: Units.h:108
inet::units::values::rad
value< double, units::rad > rad
Definition: Units.h:1245
inet::EulerAngles::gamma
rad gamma
Definition: EulerAngles.h:32
M_PI
#define M_PI
Definition: INETMath.h:52