OGLplus (0.52.0) a C++ wrapper for OpenGL

oglplus::Quaternion< T > Class Template Reference

Template class for quaternions. More...

#include </home/chochlik/devel/oglplus/include/oglplus/math/quaternion.hpp>

Public Member Functions

 Quaternion (T a, T x, T y, T z)
 Constructs a quaternion.
 
 Quaternion (Vector< T, 3 > axis, Angle< T > angle)
 Construct a Quaternion from an axis and an angle.
 
 Quaternion (T real, const Vector< T, 3 > &imag)
 Construct q Quaternion from the real and imag parts.
 
T Real (void) const
 Returns the real scalar part of the quaternion.
 
Vector< T, 3 > Imag (void) const
 Returns the imaginary vector part of the quaternion.
 
T Magnitude (void) const
 Returns the magnitude of the quaternion.
 
bool IsUnit (T eps=T(0)) const
 Returns true if the quaternion has unit Magnitude. More...
 
bool IsNormal (T eps=T(0)) const
 Synonym for IsUnit. More...
 
bool IsDegenerate (T eps=T(0)) const
 Returns true if the quaternion has zero Magnitude.
 
QuaternionNormalize (void)
 Normalizes this quaternion. More...
 

Friends

bool Equal (const Quaternion &q1, const Quaternion &q2)
 Equality comparison.
 
bool Close (const Quaternion &q1, const Quaternion &q2, T eps)
 Near-equality comparison.
 
bool operator== (const Quaternion &q1, const Quaternion &q2)
 Equality comparison.
 
bool operator!= (const Quaternion &q1, const Quaternion &q2)
 Non-equality comparison.
 
Quaternion Conjugate (const Quaternion &q1)
 Conjugate quaternion.
 
Quaternion operator~ (const Quaternion &q1)
 Conjugation.
 
Quaternion Inverse (const Quaternion &q1)
 Inverse quaternion.
 
Quaternion Add (const Quaternion &q1, const Quaternion &q2)
 Quaternion addition.
 
Quaternion operator+ (const Quaternion &q1, const Quaternion &q2)
 Addition operator.
 
Quaternion Multiply (const Quaternion &q1, const Quaternion &q2)
 Quaternion multiplication.
 
Quaternion operator* (const Quaternion &q1, const Quaternion &q2)
 Multiplication operator.
 
Quaternion operator* (const Quaternion &q1, T t)
 Multiplication by scalar operator.
 
Quaternion operator* (T t, const Quaternion &q1)
 Multiplication by scalar operator.
 
Vector< T, 3 > Rotate (const Quaternion &q, const Vector< T, 3 > &v)
 Rotate a vector by this quaternion. More...
 

Detailed Description

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

Template class for quaternions.

Member Function Documentation

template<typename T>
bool oglplus::Quaternion< T >::IsNormal ( T  eps = T(0)) const

Synonym for IsUnit.

See Also
IsUnit
Normalize

References oglplus::Quaternion< T >::IsUnit().

template<typename T>
bool oglplus::Quaternion< T >::IsUnit ( T  eps = T(0)) const

Returns true if the quaternion has unit Magnitude.

See Also
IsNormal
Normalize

References oglplus::T.

Referenced by oglplus::Quaternion< T >::IsNormal().

template<typename T>
Quaternion& oglplus::Quaternion< T >::Normalize ( void  )

Normalizes this quaternion.

Precondition
!this->IsDegenerate();
Postcondition
this->IsUnit()

References oglplus::Quaternion< T >::Magnitude(), and oglplus::T.

Friends And Related Function Documentation

template<typename T>
Vector<T, 3> Rotate ( const Quaternion< T > &  q,
const Vector< T, 3 > &  v 
)
friend

Rotate a vector by this quaternion.

Precondition
this->IsNormal()

The documentation for this class was generated from the following files:
  • /home/chochlik/devel/oglplus/include/oglplus/fwd.hpp
  • /home/chochlik/devel/oglplus/include/oglplus/math/quaternion.hpp

Copyright © 2010-2014 Matúš Chochlík, University of Žilina, Žilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Mon Sep 22 2014 by Doxygen (version 1.8.6).