Manifold 3.0
Robust geometry
 
Loading...
Searching...
No Matches
Quaternions

Support for quaternion algebra using 4D vectors of arbitrary length, representing xi + yj + zk + w. More...

Functions

template<class T >
constexpr vec< T, 4 > qconj (const vec< T, 4 > &q)
 conjugate of quaternion q
 
template<class T >
vec< T, 4 > qinv (const vec< T, 4 > &q)
 inverse or reciprocal of quaternion q (undefined for zero-length quaternions)
 
template<class T >
vec< T, 4 > qexp (const vec< T, 4 > &q)
 exponential of quaternion q
 
template<class T >
vec< T, 4 > qlog (const vec< T, 4 > &q)
 logarithm of quaternion q
 
template<class T >
vec< T, 4 > qpow (const vec< T, 4 > &q, const T &p)
 quaternion q raised to the exponent p
 
template<class T >
constexpr vec< T, 4 > qmul (const vec< T, 4 > &a, const vec< T, 4 > &b)
 Hamilton product of quaternions a and b
 
template<class T , class... R>
constexpr vec< T, 4 > qmul (const vec< T, 4 > &a, R... r)
 Multiply as many input quaternions together as desired.
 

Detailed Description

Support for quaternion algebra using 4D vectors of arbitrary length, representing xi + yj + zk + w.