pub struct DualQuaternion<T> { /* private fields */ }
Implementations§
Source§impl<T> DualQuaternion<T>
impl<T> DualQuaternion<T>
pub const fn new(q_real: Quaternion<T>, q_dual: Quaternion<T>) -> Self
Source§impl<T: Num + Copy> DualQuaternion<T>
impl<T: Num + Copy> DualQuaternion<T>
Sourcepub fn real(&self) -> Quaternion<T>
pub fn real(&self) -> Quaternion<T>
Get the real Quaternion part
Sourcepub fn dual(&self) -> Quaternion<T>
pub fn dual(&self) -> Quaternion<T>
Get the dual Quaternion part
Sourcepub fn new_from_rotation(r: &Quaternion<T>) -> Self
pub fn new_from_rotation(r: &Quaternion<T>) -> Self
Create a pure rotation transformation from a given Quaternion
Sourcepub fn new_from_point(v: &V3<T>) -> Self
pub fn new_from_point(v: &V3<T>) -> Self
Create a Dual Quaternion that represent a point when the real part is a unit and the dual part is a pure Quaternion
Source§impl<T: Float + Signed> DualQuaternion<T>
impl<T: Float + Signed> DualQuaternion<T>
Sourcepub fn to_homogeneous(&self) -> M44<T>
pub fn to_homogeneous(&self) -> M44<T>
Convert the DualQuaternion
to a homogeneus transformation matrix M44<Float>
in SE(3)
Sourcepub fn get_screw_parameters(&self) -> (V3<T>, V3<T>, T, T)
pub fn get_screw_parameters(&self) -> (V3<T>, V3<T>, T, T)
Get the screw parameters from this DualQuaternion
the implementation follow the following
paper: “Dual Quaternions” by Yan-Bin Jia
Output:
l: V3
Sourcepub fn new_from_screw_parameters(l: &V3<T>, m: &V3<T>, theta: T, d: T) -> Self
pub fn new_from_screw_parameters(l: &V3<T>, m: &V3<T>, theta: T, d: T) -> Self
Create a DualQuaternion
from the screw parameters
Function arguments:
l
: a unit vector that represent the screw axis
m
: screw axis moment that its perpendicular to l (m * l = 0) and the norm represent the
actual moment
theta
: screw angle, represent the amount of rotation around the screw axis
d
: screw displacement, represent the amount of displacement along the screw axis
Sourcepub fn pow(&self, exponent: T) -> Self
pub fn pow(&self, exponent: T) -> Self
Compute the power of the DualQuaternion
Function arguments:
exponent
: Float the exponent to raise the power
Output: Self^(exponent)
Sourcepub fn screw_lerp(begin: &Self, end: &Self, tau: T) -> Self
pub fn screw_lerp(begin: &Self, end: &Self, tau: T) -> Self
Screw Linear Interpolation: is an extension of the spherical linear interpolation (SLERP)
over Quaternions. It performs a screw motion with constant rotation and translation speeds
from begin
to end
Function arguments:
begin
: DualQuaternion<Float>
the first “point” for the interpolation
end
: DualQuaternion<Float>
the second “point” for the interpolation
tau
: Float in [0, 1] representing how far along and around the screw axis to interpolate
pub fn log(&self) -> Option<Self>
Source§impl<T: Float> DualQuaternion<T>
impl<T: Float> DualQuaternion<T>
Sourcepub fn new_from_array(array: [T; 7]) -> Self
pub fn new_from_array(array: [T; 7]) -> Self
Create a DualQuaternion
from an array that encodes a Quaternion and a 3d vecto (V3
Sourcepub fn new_from_translation(t: &V3<T>) -> Self
pub fn new_from_translation(t: &V3<T>) -> Self
Create a DualQuaternion
that represent a pure translation transformation
Sourcepub fn new_from_rot_trans(rot: &Quaternion<T>, translation: &V3<T>) -> Self
pub fn new_from_rot_trans(rot: &Quaternion<T>, translation: &V3<T>) -> Self
Create a new DualQuaternion from a rotation(Quaternion) and translation(V3)
pub fn is_normalized(&self) -> bool
Source§impl<T: Float + FloatConst + Sum> DualQuaternion<T>
impl<T: Float + FloatConst + Sum> DualQuaternion<T>
Sourcepub fn new_from_homogeneous(t: &M44<T>) -> Self
pub fn new_from_homogeneous(t: &M44<T>) -> Self
Create a new DualQuaternion
from a homogeneous transformation matrix in SE(3)
Sourcepub fn new_from_rotation_matrix(m: &M33<T>) -> Self
pub fn new_from_rotation_matrix(m: &M33<T>) -> Self
Create a DualQuaternion
that represent a rotation pure transformation
Source§impl<T: Num + Copy + Signed> DualQuaternion<T>
impl<T: Num + Copy + Signed> DualQuaternion<T>
Sourcepub fn conj_as_dual(&self) -> Self
pub fn conj_as_dual(&self) -> Self
Calculate the dual number conjugation of the DualQuaternion
Sourcepub fn conj_combined(&self) -> Self
pub fn conj_combined(&self) -> Self
Calculate the combined(as a dual number and Quaternion) conjugation of the DualQuaternion
Sourcepub fn to_rotation_translation(&self) -> (M33<T>, V3<T>)
pub fn to_rotation_translation(&self) -> (M33<T>, V3<T>)
Get the underlying rotation and translation from the DualQuaternion
Sourcepub fn get_translation(&self) -> V3<T>
pub fn get_translation(&self) -> V3<T>
Get the underlying translation from the DualQuaternion
Sourcepub fn to_quaternion_translation(&self) -> (Quaternion<T>, V3<T>)
pub fn to_quaternion_translation(&self) -> (Quaternion<T>, V3<T>)
Get the underlying Quaternion and translation from the DualQuaternion
Sourcepub fn transform_point(&self, point: &V3<T>) -> V3<T>
pub fn transform_point(&self, point: &V3<T>) -> V3<T>
Transform the given point in 3D with the transformation that represent this
DualQuaternion
like a homogeneous transformation in SE(3)
Source§impl<T: Num + Copy> DualQuaternion<T>
impl<T: Num + Copy> DualQuaternion<T>
Sourcepub fn new_from_vecs(q_real: &V4<T>, q_dual: &V4<T>) -> Self
pub fn new_from_vecs(q_real: &V4<T>, q_dual: &V4<T>) -> Self
Construct a new DualQuaternion from two V4
Sourcepub fn one() -> DualQuaternion<T>
pub fn one() -> DualQuaternion<T>
construct a unit DualQuaternion
Trait Implementations§
Source§impl<T: Clone> Clone for DualQuaternion<T>
impl<T: Clone> Clone for DualQuaternion<T>
Source§fn clone(&self) -> DualQuaternion<T>
fn clone(&self) -> DualQuaternion<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more