DUECA/DUSIME
Loading...
Searching...
No Matches
Functions
RvPQuat.hxx File Reference

A random collection of quaternion code. More...

Include dependency graph for RvPQuat.hxx:
This graph shows which files directly or indirectly include this file:

Functions

template<class T >
double dueca::Q2phi (const T &quat)
 Extract the roll angle from a rotation quaternion.
 
template<class T >
double dueca::Q2tht (const T &quat)
 Extract the pitch angle from a rotation quaternion.
 
template<class T >
double dueca::Q2psi (const T &quat)
 Extract the yaw angle from a rotation quaternion.
 
template<class T1 , class T2 >
void dueca::phithtpsi2Q (T1 &quat, const T2 phi, const T2 tht, const T2 psi)
 Construct a quaternion from Euler-Rodriguez angles.
 
template<class T , class U , class V >
void dueca::QxQ (T &result, const U &q1, const V &q2)
 Multiply two quaternions.
 
template<class T >
void dueca::Qconjugate (T &q)
 Convert a quaternion to its conjugate.
 
template<typename S , typename T >
Sdueca::printQ (S &s, const T &quat)
 Print a quaternion to stream.
 
template<typename S , typename T >
Sdueca::printPTP (S &s, const T &quat)
 Print a quaternion to stream in its Euler angles form.
 
template<typename M , typename T >
void dueca::Q2R (M &mat, const T &q)
 Calculate the rotation matrix for a quaternion.
 
template<class Mat , class Vec >
void dueca::cross_prod_matrix (Mat &m, const Vec &v)
 Cross-product matrix set up from a vector.
 

Detailed Description

A random collection of quaternion code.

Function Documentation

◆ Q2phi()

template<class T >
double dueca::Q2phi ( const T & quat)
inline

Extract the roll angle from a rotation quaternion.

Template Parameters
Tvector type
Parameters
quatgiven quaternion
Returns
Roll angle, double

◆ Q2tht()

template<class T >
double dueca::Q2tht ( const T & quat)
inline

Extract the pitch angle from a rotation quaternion.

Template Parameters
Tvector type
Parameters
quatgiven quaternion
Returns
Pitch angle, double

◆ Q2psi()

template<class T >
double dueca::Q2psi ( const T & quat)
inline

Extract the yaw angle from a rotation quaternion.

Template Parameters
Tvector type
Parameters
quatgiven quaternion
Returns
Yaw angle, double

◆ phithtpsi2Q()

template<class T1 , class T2 >
void dueca::phithtpsi2Q ( T1 & quat,
const T2 phi,
const T2 tht,
const T2 psi )
inline

Construct a quaternion from Euler-Rodriguez angles.

Template Parameters
T1Vector type for quaternion
T2Data type for angles
Parameters
quatReturned, quaternion vector
phiRoll angle
thtPitch angle
psiYaw angle

◆ QxQ()

template<class T , class U , class V >
void dueca::QxQ ( T & result,
const U & q1,
const V & q2 )
inline

Multiply two quaternions.

Template Parameters
TVector type for result quaternion
UVector type for first
VVector type for second
Parameters
resultResult quaternion
q1First input
q2Second input

◆ Qconjugate()

template<class T >
void dueca::Qconjugate ( T & q)
inline

Convert a quaternion to its conjugate.

Template Parameters
TFour-element vector/array type
Parameters
qQuaternion to change

◆ printQ()

template<typename S , typename T >
S & dueca::printQ ( S & s,
const T & quat )

Print a quaternion to stream.

Template Parameters
SStream type
TFour-element vector/array type
Parameters
sStream object
quatQuaternion
Returns
A reference to the stream object

◆ printPTP()

template<typename S , typename T >
S & dueca::printPTP ( S & s,
const T & quat )

Print a quaternion to stream in its Euler angles form.

Template Parameters
SStream type
TFour-element vector/array type
Parameters
sStream object
quatQuaternion
Returns
A reference to the stream object

◆ Q2R()

template<typename M , typename T >
void dueca::Q2R ( M & mat,
const T & q )
inline

Calculate the rotation matrix for a quaternion.

Template Parameters
MMatrix format
TFour-element vector/array type
Parameters
matMatrix to be filled
qRotation quaternion

◆ cross_prod_matrix()

template<class Mat , class Vec >
void dueca::cross_prod_matrix ( Mat & m,
const Vec & v )
inline

Cross-product matrix set up from a vector.

Template Parameters
MatMatrix type
VecQuaternion vector type
Parameters
mResulting matrix
vThree-element vector