OpenLexocad  27.1
Base::DualQuat Class Reference

The DualQuat class represents a dual quaternion, as a quaternion of dual number components. Dual quaternions are useful for placement interpolation, see pow method. More...

#include <DualQuaternion.h>

Public Member Functions

 DualQuat ()
 default constructor: init with zeros More...
 
 DualQuat (DualNumber x, DualNumber y, DualNumber z, DualNumber w)
 
 DualQuat (double x, double y, double z, double w, double dx, double dy, double dz, double dw)
 
 DualQuat (double x, double y, double z, double w)
 
 DualQuat (DualQuat re, DualQuat du)
 Builds a dual quaternion from real and dual parts provided as pure real quaternions. More...
 
DualQuat real () const
 return a copy with dual part zeroed out More...
 
DualQuat dual () const
 return a real-only quaternion made from dual part of this quaternion. More...
 
DualQuat conj () const
 conjugate More...
 
DualQuat vec () const
 return vector part (with scalar part zeroed out) More...
 
double length () const
 magnitude of the quaternion More...
 
double theta () const
 angle of rotation represented by this quaternion, in radians More...
 
DualQuat pow (double t, bool shorten=true) const
 ScLERP. t=0.0 returns identity, t=1.0 returns this. t can also be outside of 0..1 bounds. More...
 
DualQuat operator- () const
 

Static Public Member Functions

static DualQuat identity ()
 returns dual quaternion for identity placement More...
 
static double dot (DualQuat a, DualQuat b)
 dot product between real (rotation) parts of two dual quaternions (to determine if one of them should be negated for shortest interpolation) More...
 

Public Attributes

DualNumber x
 
DualNumber y
 
DualNumber z
 
DualNumber w
 

Detailed Description

The DualQuat class represents a dual quaternion, as a quaternion of dual number components. Dual quaternions are useful for placement interpolation, see pow method.

Rotation is stored as non-dual part of DualQ. Translation is encoded into dual part of DualQuat: DualQuat.dual() = 0.5 * t * r, where t is quaternion with x,y,z of translation and w of 0, and r is the rotation quaternion.

Constructor & Destructor Documentation

◆ DualQuat() [1/5]

Base::DualQuat::DualQuat ( )
inline

default constructor: init with zeros

◆ DualQuat() [2/5]

Base::DualQuat::DualQuat ( DualNumber  x,
DualNumber  y,
DualNumber  z,
DualNumber  w 
)
inline

◆ DualQuat() [3/5]

Base::DualQuat::DualQuat ( double  x,
double  y,
double  z,
double  w,
double  dx,
double  dy,
double  dz,
double  dw 
)
inline

◆ DualQuat() [4/5]

Base::DualQuat::DualQuat ( double  x,
double  y,
double  z,
double  w 
)
inline

◆ DualQuat() [5/5]

Base::DualQuat::DualQuat ( DualQuat  re,
DualQuat  du 
)

Builds a dual quaternion from real and dual parts provided as pure real quaternions.

Member Function Documentation

◆ conj()

DualQuat Base::DualQuat::conj ( ) const
inline

conjugate

◆ dot()

static double Base::DualQuat::dot ( DualQuat  a,
DualQuat  b 
)
static

dot product between real (rotation) parts of two dual quaternions (to determine if one of them should be negated for shortest interpolation)

◆ dual()

DualQuat Base::DualQuat::dual ( ) const
inline

return a real-only quaternion made from dual part of this quaternion.

◆ identity()

static DualQuat Base::DualQuat::identity ( )
inlinestatic

returns dual quaternion for identity placement

◆ length()

double Base::DualQuat::length ( ) const
inline

magnitude of the quaternion

◆ operator-()

DualQuat Base::DualQuat::operator- ( ) const
inline

◆ pow()

DualQuat Base::DualQuat::pow ( double  t,
bool  shorten = true 
) const

ScLERP. t=0.0 returns identity, t=1.0 returns this. t can also be outside of 0..1 bounds.

◆ real()

DualQuat Base::DualQuat::real ( ) const
inline

return a copy with dual part zeroed out

◆ theta()

double Base::DualQuat::theta ( ) const
inline

angle of rotation represented by this quaternion, in radians

◆ vec()

DualQuat Base::DualQuat::vec ( ) const
inline

return vector part (with scalar part zeroed out)

Member Data Documentation

◆ w

DualNumber Base::DualQuat::w

◆ x

DualNumber Base::DualQuat::x

◆ y

DualNumber Base::DualQuat::y

◆ z

DualNumber Base::DualQuat::z

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