vmmlib  1.13.0
Templatized C++ vector and matrix math library
vmml::Quaternion< T > Class Template Reference
+ Collaboration diagram for vmml::Quaternion< T >:

Public Member Functions

 Quaternion ()
 Construct an identity quaternion.
 
 Quaternion (T x, T y, T z, T w)
 
 Quaternion (T angle, vector< 3, T > axis)
 Construct a rotation quaternion.
 
template<size_t M>
 Quaternion (const Matrix< M, M, T > &rotation_matrix_, typename std::enable_if< M >=3 >::type *=0)
 
void normalize ()
 
Quaternionoperator= (const Quaternion &other)
 
Data Access
bool equals (const Quaternion &other, T tolerance=std::numeric_limits< T >::epsilon()) const
 
x () const
 
y () const
 
z () const
 
w () const
 
bool operator== (const Quaternion &a) const
 
bool operator!= (const Quaternion &a) const
 
Quaternion operator- () const
 
Quaternion inverse () const
 
Quaternion getConjugate () const
 
abs () const
 
absSquare () const
 
Matrix< 3, 3, T > getRotationMatrix () const
 
quaternion/quaternion operations
Quaternion operator+ (const Quaternion< T > &a) const
 
Quaternion operator- (const Quaternion< T > &a) const
 
Quaternion operator* (const Quaternion< T > &a) const
 
void operator+= (const Quaternion< T > &a)
 
void operator-= (const Quaternion< T > &a)
 
void operator*= (const Quaternion< T > &a)
 
quaternion/scalar operations
Quaternion operator* (T a) const
 
Quaternion operator/ (T a) const
 
void operator*= (T a)
 
void operator/= (T a)
 

Public Attributes

array [4]
 

Friends

std::ostream & operator<< (std::ostream &os, const Quaternion &q)
 

Detailed Description

template<typename T>
class vmml::Quaternion< T >

Definition at line 50 of file quaternion.hpp.

Member Function Documentation

template<typename T >
bool vmml::Quaternion< T >::equals ( const Quaternion< T > &  other,
tolerance = std::numeric_limits<T>::epsilon() 
) const
Returns
true if the two quaternion are similar.

Definition at line 274 of file quaternion.hpp.

Referenced by vmml::Quaternion< T >::Quaternion().

+ Here is the caller graph for this function:

template<typename T >
Matrix< 3, 3, T > vmml::Quaternion< T >::getRotationMatrix ( ) const
Returns
the corresponding 3x3 rotation matrix.

Definition at line 457 of file quaternion.hpp.

Referenced by vmml::Matrix< R, C, T >::Matrix(), and vmml::Quaternion< T >::Quaternion().

+ Here is the caller graph for this function:

template<typename T >
Quaternion< T > vmml::Quaternion< T >::inverse ( ) const
Returns
multiplicative inverse quaternion

Definition at line 315 of file quaternion.hpp.

References vmml::Quaternion< T >::operator-(), and vmml::Quaternion< T >::Quaternion().

Referenced by vmml::Quaternion< T >::Quaternion().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
bool vmml::Quaternion< T >::operator!= ( const Quaternion< T > &  a) const
Returns
true if both quaternions are not equal.

Definition at line 290 of file quaternion.hpp.

References vmml::Quaternion< T >::operator==().

Referenced by vmml::Quaternion< T >::Quaternion().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
Quaternion< T > vmml::Quaternion< T >::operator- ( ) const
Returns
the negated quaternion of this quaternion.

Definition at line 392 of file quaternion.hpp.

References vmml::Quaternion< T >::Quaternion().

Referenced by vmml::Quaternion< T >::inverse(), and vmml::Quaternion< T >::Quaternion().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
bool vmml::Quaternion< T >::operator== ( const Quaternion< T > &  a) const
Returns
true if both quaternions are equal.

Definition at line 283 of file quaternion.hpp.

Referenced by vmml::Quaternion< T >::operator!=(), and vmml::Quaternion< T >::Quaternion().

+ Here is the caller graph for this function:


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