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 |
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.
| Base::DualQuat::DualQuat | ( | ) |
default constructor: init with zeros
| Base::DualQuat::DualQuat | ( | DualNumber | x, |
| DualNumber | y, | ||
| DualNumber | z, | ||
| DualNumber | w | ||
| ) |
| Base::DualQuat::DualQuat | ( | double | x, |
| double | y, | ||
| double | z, | ||
| double | w, | ||
| double | dx, | ||
| double | dy, | ||
| double | dz, | ||
| double | dw | ||
| ) |
| Base::DualQuat::DualQuat | ( | double | x, |
| double | y, | ||
| double | z, | ||
| double | w | ||
| ) |
| Base::DualQuat::DualQuat | ( | Base::DualQuat | re, |
| Base::DualQuat | du | ||
| ) |
| DualQuat Base::DualQuat::conj | ( | ) | const |
conjugate
Referenced by Base::Placement::fromDualQuaternion().
|
static |
dot product between real (rotation) parts of two dual quaternions (to determine if one of them should be negated for shortest interpolation)
| DualQuat Base::DualQuat::dual | ( | ) | const |
return a real-only quaternion made from dual part of this quaternion.
Referenced by DualQuat(), Base::Placement::fromDualQuaternion(), and pow().
|
static |
returns dual quaternion for identity placement
| double Base::DualQuat::length | ( | ) | const |
magnitude of the quaternion
Referenced by DualQuat(), PathScripts.PathStock.StockFromBase::execute(), PathScripts.PathDressupDogbone.ObjectDressup::execute(), PathScripts.PathFeatureExtensions.Extension::getSubLink(), PathScripts.PathFeatureExtensions.Extension::getWire(), and Mod.PartDesign.Scripts.FilletArc.Vector::norm().
| DualQuat Base::DualQuat::operator- | ( | ) | const |
| 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 Base::DualNumber::du, dual(), real(), theta(), vec(), draftgeoutils.general::vec(), and w.
| DualQuat Base::DualQuat::real | ( | ) | const |
return a copy with dual part zeroed out
Referenced by Base::Placement::fromDualQuaternion(), and pow().
| double Base::DualQuat::theta | ( | ) | const |
angle of rotation represented by this quaternion, in radians
References draftgeoutils.general::vec().
Referenced by Mod.PartDesign.fcgear.fcgear.FCWireBuilder::arc(), Mod.PartDesign.fcgear.svggear.SVGWireBuilder::arc(), Mod.PartDesign.fcsprocket.fcsprocket.FCWireBuilder::arc(), Mod.PartDesign.fcgear.fcgear.FCWireBuilder::curve(), Mod.PartDesign.fcgear.svggear.SVGWireBuilder::curve(), Mod.PartDesign.fcsprocket.fcsprocket.FCWireBuilder::curve(), Mod.PartDesign.fcgear.fcgear.FCWireBuilder::line(), Mod.PartDesign.fcgear.svggear.SVGWireBuilder::line(), Mod.PartDesign.fcsprocket.fcsprocket.FCWireBuilder::line(), Mod.PartDesign.fcgear.svggear.SVGWireBuilder::move(), and pow().
| DualQuat Base::DualQuat::vec | ( | ) | const |
return vector part (with scalar part zeroed out)
Referenced by pow().
| DualNumber Base::DualQuat::w |
| DualNumber Base::DualQuat::x |
Referenced by Mod.PartDesign.Scripts.FilletArc.Vector::add(), DraftGui.DraftToolBar::changeXValue(), importSVG.svgHandler::characters(), PathScripts.PathInspect.GCodeEditorDialog::cleanup(), Mod.PartDesign.Scripts.FilletArc.Vector::cross(), PathScripts.PostUtils.GCodeEditorDialog::done(), Mod.PartDesign.Scripts.FilletArc.Vector::dot(), Base::Placement::fromDualQuaternion(), Mod.PartDesign.Scripts.FilletArc.Vector::length(), Mod.PartDesign.Scripts.FilletArc.Vector::mult(), Mod.PartDesign.Scripts.FilletArc.Vector::norm(), PathScripts.PathDressupHoldingTags.Tag::originAt(), DraftGui.DraftToolBar::pointUi(), DraftGui.DraftToolBar::reset_ui_values(), Mod.PartDesign.Scripts.FilletArc.Vector::sub(), Base::Placement::toDualQuaternion(), DraftGui.DraftToolBar::update_cartesian_coords(), DraftGui.DraftToolBar::update_spherical_coords(), DraftGui.DraftToolBar::updateSnapper(), DraftGui.DraftToolBar::validatePoint(), and automotive_design.right_angular_wedge::wr1().
| DualNumber Base::DualQuat::y |
Referenced by Mod.PartDesign.Scripts.FilletArc.Vector::add(), DraftGui.DraftToolBar::changeYValue(), importSVG.svgHandler::characters(), PathScripts.PathInspect.GCodeEditorDialog::cleanup(), Mod.PartDesign.Scripts.FilletArc.Vector::cross(), PathScripts.PostUtils.GCodeEditorDialog::done(), Mod.PartDesign.Scripts.FilletArc.Vector::dot(), Base::Placement::fromDualQuaternion(), Mod.PartDesign.Scripts.FilletArc.Vector::length(), Mod.PartDesign.Scripts.FilletArc.Vector::mult(), Mod.PartDesign.Scripts.FilletArc.Vector::norm(), PathScripts.PathDressupHoldingTags.Tag::originAt(), DraftGui.DraftToolBar::pointUi(), DraftGui.DraftToolBar::reset_ui_values(), Mod.PartDesign.Scripts.FilletArc.Vector::sub(), Base::Placement::toDualQuaternion(), DraftGui.DraftToolBar::update_cartesian_coords(), DraftGui.DraftToolBar::update_spherical_coords(), DraftGui.DraftToolBar::updateSnapper(), and DraftGui.DraftToolBar::validatePoint().
| DualNumber Base::DualQuat::z |
Referenced by Mod.PartDesign.Scripts.FilletArc.Vector::add(), automotive_design.revolved_area_solid::axis_line(), automotive_design.surface_of_revolution::axis_line(), automotive_design.revolved_face_solid::axis_line(), ifc4.ifcrevolvedareasolid::axisdirectioninxy(), ifc2x3.ifcsurfaceofrevolution::axisline(), ifc2x3.ifcrevolvedareasolid::axisline(), ifc4.ifcsurfaceofrevolution::axisline(), ifc4.ifcrevolvedareasolid::axisline(), PathScripts.PathDressupHoldingTags.Tag::bottom(), DraftGui.DraftToolBar::changeZValue(), PathScripts.PathDressupTag.TagSolid::cloneAt(), PathScripts.PathDressupHoldingTags.Tag::createSolidsAt(), Mod.PartDesign.Scripts.FilletArc.Vector::cross(), Mod.PartDesign.Scripts.FilletArc.Vector::dot(), Base::Placement::fromDualQuaternion(), Mod.PartDesign.Scripts.FilletArc.Vector::length(), Mod.PartDesign.Scripts.FilletArc.Vector::mult(), Mod.PartDesign.Scripts.FilletArc.Vector::norm(), DraftGui.DraftToolBar::pointUi(), DraftGui.DraftToolBar::reset_ui_values(), importSH3D.SH3DHandler::startElement(), Mod.PartDesign.Scripts.FilletArc.Vector::sub(), Base::Placement::toDualQuaternion(), PathScripts.PathDressupHoldingTags.Tag::top(), DraftGui.DraftToolBar::update_cartesian_coords(), DraftGui.DraftToolBar::update_spherical_coords(), DraftGui.DraftToolBar::updateSnapper(), DraftGui.DraftToolBar::validatePoint(), and ifc2x3.ifcrevolvedareasolid::wr32().