Flair
Framework Libre Air
flair::core::Quaternion Class Reference

Class defining a quaternion. More...

#include <Quaternion.h>

Public Member Functions

 Quaternion (float q0=1, float q1=0, float q2=0, float q3=0)
 Constructor. More...
 
 ~Quaternion ()
 Destructor. More...
 
float GetNorm (void) const
 Norm. More...
 
void Normalize (void)
 Normalize. More...
 
void GetLogarithm (Vector3Df &logarithm)
 Logarithm. More...
 
Vector3Df GetLogarithm (void)
 Logarithm. More...
 
void Conjugate (void)
 Conjugate. More...
 
Quaternion GetConjugate (void)
 Conjugate. More...
 
Quaternion GetDerivative (const Vector3Df &angularSpeed) const
 Derivative. More...
 
void Derivate (const Vector3Df &angularSpeed)
 Derivate. More...
 
void ToEuler (Euler &euler) const
 Convert to euler angles. More...
 
Euler ToEuler (void) const
 Convert to euler angles. More...
 
void ToRotationMatrix (RotationMatrix &matrix) const
 Convert to rotation matrix. More...
 
Quaternionoperator+= (const Quaternion &quaternion)
 
Quaternionoperator-= (const Quaternion &quaternion)
 
Quaternionoperator= (const Quaternion &quaternion)
 

Public Attributes

float q0
 q0 More...
 
float q1
 q1 More...
 
float q2
 q2 More...
 
float q3
 q3 More...
 

Detailed Description

Class defining a quaternion.

Constructor & Destructor Documentation

flair::core::Quaternion::Quaternion ( float  q0 = 1,
float  q1 = 0,
float  q2 = 0,
float  q3 = 0 
)

Constructor.

Construct a quaternion using specified values.

Parameters
q0,scalarpart
q1
q2
q3
flair::core::Quaternion::~Quaternion ( )

Destructor.

Member Function Documentation

float flair::core::Quaternion::GetNorm ( void  ) const

Norm.

Returns
norm
void flair::core::Quaternion::Normalize ( void  )

Normalize.

void flair::core::Quaternion::GetLogarithm ( Vector3Df logarithm)

Logarithm.

This method also Normalize the quaternion.

Parameters
logarithmoutput logarithm
Vector3Df flair::core::Quaternion::GetLogarithm ( void  )

Logarithm.

This method also Normalize the quaternion.

Returns
output logarithm
void flair::core::Quaternion::Conjugate ( void  )

Conjugate.

Quaternion flair::core::Quaternion::GetConjugate ( void  )

Conjugate.

Returns
Conjugate
Quaternion flair::core::Quaternion::GetDerivative ( const Vector3Df angularSpeed) const

Derivative.

Parameters
wangular speed
Returns
derivative
void flair::core::Quaternion::Derivate ( const Vector3Df angularSpeed)

Derivate.

Parameters
wrotationonal speed
void flair::core::Quaternion::ToEuler ( Euler euler) const

Convert to euler angles.

Parameters
euleroutput euler angles
Euler flair::core::Quaternion::ToEuler ( void  ) const

Convert to euler angles.

Returns
euler angles
void flair::core::Quaternion::ToRotationMatrix ( RotationMatrix matrix) const

Convert to rotation matrix.

Parameters
moutput matrix

Member Data Documentation

float flair::core::Quaternion::q0

q0

float flair::core::Quaternion::q1

q1

float flair::core::Quaternion::q2

q2

float flair::core::Quaternion::q3

q3