All Classes Files Functions Variables Typedefs Pages
Public Member Functions | Public Attributes | List of all members
Quaternion< T > Struct Template Reference

Description

template<typename T>
struct lumina::Quaternion< T >

Represents the hamilton ring H(T) for an arbitrary type T.

For certain special values of T, this might alternatively be called the set of quaternions. The quaternion represented is q = w + xi + yj + zk.

Template Parameters
Tcoefficient type. Assumed to be a ring.

Public Member Functions

 Quaternion (T w, T x, T y, T z)
 
bool operator== (const Quaternion< T > &other) const
 
bool operator!= (const Quaternion< T > &other) const
 
Quaternion< T > operator+ () const
 
Quaternion< T > operator- () const
 
template<typename OT >
Quaternion< T > & operator+= (const Quaternion< OT > q)
 
template<typename OT >
Quaternion< T > & operator-= (const Quaternion< OT > &q)
 
template<typename S >
Quaternion< T > & operator*= (S s)
 
template<typename S >
Quaternion< T > & operator/= (S s)
 
lengthSquared () const
 
template<typename Tout = decltype(std::sqrt(T(0)))>
Tout length () const
 
Quaternion< T > & normalize ()
 
Quaternion< T > normalized () const
 
template<typename OT >
Quaternion< T > & operator*= (const Quaternion< OT > &q)
 
Quaternion< T > & invert ()
 
Quaternion< T > inverse ()
 
Quaternion< T > & conjugate ()
 
Quaternion< T > conjugated ()
 

Public Attributes

w
 
x
 
y
 
z