The DualQuat class represents a dual quaternion, as a quaternion of dual number components. More...

#include <DualQuaternion.h>

Public Member Functions

DualQuat conj () const
 conjugate More...
 
DualQuat dual () const
 return a real-only quaternion made from dual part of this quaternion. More...
 
 DualQuat ()
 default constructor: init with zeros More...
 
 DualQuat (double x, double y, double z, double w)
 
 DualQuat (double x, double y, double z, double w, double dx, double dy, double dz, double dw)
 
 DualQuat (DualNumber x, DualNumber y, DualNumber z, DualNumber w)
 
 DualQuat (DualQuat re, DualQuat du)
 Builds a dual quaternion from real and dual parts provided as pure real quaternions. More...
 
double length () const
 magnitude of the quaternion More...
 
DualQuat operator- () const
 
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 real () const
 return a copy with dual part zeroed out More...
 
double theta () const
 angle of rotation represented by this quaternion, in radians More...
 
DualQuat vec () const
 return vector part (with scalar part zeroed out) More...
 

Static Public Member Functions

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...
 
static DualQuat identity ()
 returns dual quaternion for identity placement More...
 

Public Attributes

DualNumber w
 
DualNumber x
 
DualNumber y
 
DualNumber z
 

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 ( )

default constructor: init with zeros

◆ DualQuat() [2/5]

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

◆ DualQuat() [3/5]

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

◆ DualQuat() [4/5]

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

◆ DualQuat() [5/5]

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

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

References dual(), and length().

Member Function Documentation

◆ conj()

DualQuat Base::DualQuat::conj ( ) const

conjugate

Referenced by Base::Placement::fromDualQuaternion().

◆ dot()

double Base::DualQuat::dot ( Base::DualQuat  a,
Base::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

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

Referenced by DualQuat(), and Base::Placement::fromDualQuaternion().

◆ identity()

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

returns dual quaternion for identity placement

◆ length()

◆ operator-()

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

◆ pow()

Base::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.

References theta(), and draftgeoutils.general::vec().

◆ real()

DualQuat Base::DualQuat::real ( ) const

return a copy with dual part zeroed out

Referenced by Base::Placement::fromDualQuaternion().

◆ theta()

◆ vec()

DualQuat Base::DualQuat::vec ( ) const

return vector part (with scalar part zeroed out)

Member Data Documentation

◆ w

◆ x

◆ y

◆ z


The documentation for this class was generated from the following files:
  • Sources/FreeCAD/src/Base/DualQuaternion.h
  • Sources/FreeCAD/src/Base/DualQuaternion.cpp