Struct DualQuaternion

Source
pub struct DualQuaternion<T> { /* private fields */ }

Implementations§

Source§

impl<T> DualQuaternion<T>

Source

pub const fn new(q_real: Quaternion<T>, q_dual: Quaternion<T>) -> Self

Source§

impl<T: Num + Copy> DualQuaternion<T>

Source

pub fn real(&self) -> Quaternion<T>

Get the real Quaternion part

Source

pub fn dual(&self) -> Quaternion<T>

Get the dual Quaternion part

Source

pub fn new_from_rotation(r: &Quaternion<T>) -> Self

Create a pure rotation transformation from a given Quaternion

Source

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>

Source

pub fn to_homogeneous(&self) -> M44<T>

Convert the DualQuaternion to a homogeneus transformation matrix M44<Float> in SE(3)

Source

pub fn inverse(&self) -> Self

Calculate the inverse of the DualQuaternion

Source

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 a unit 3d vector that represent one of the plucker coordinates m: V3 a vector in 3d that represent the moment of the line l and his norm represent the distance from the origin to the line theta: Float the amount of rotation around the screw axis l d: Float the amount of translation along the screw axis l

Source

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

Source

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)

Source

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

Source

pub fn log(&self) -> Option<Self>

Source§

impl<T: Float> DualQuaternion<T>

Source

pub fn new_from_array(array: [T; 7]) -> Self

Create a DualQuaternion from an array that encodes a Quaternion and a 3d vecto (V3)

Source

pub fn new_from_translation(t: &V3<T>) -> Self

Create a DualQuaternion that represent a pure translation transformation

Source

pub fn new_from_rot_trans(rot: &Quaternion<T>, translation: &V3<T>) -> Self

Create a new DualQuaternion from a rotation(Quaternion) and translation(V3)

Source

pub fn is_normalized(&self) -> bool

Source§

impl<T: Float + FloatConst + Sum> DualQuaternion<T>

Source

pub fn normalize(&self) -> Option<Self>

Normalize the DualQuaternion only if necessary

Source

pub fn new_from_homogeneous(t: &M44<T>) -> Self

Create a new DualQuaternion from a homogeneous transformation matrix in SE(3)

Source

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>

Source

pub fn conj(&self) -> Self

Calculate the conjugate of the DualQuaternion

Source

pub fn conj_as_dual(&self) -> Self

Calculate the dual number conjugation of the DualQuaternion

Source

pub fn conj_combined(&self) -> Self

Calculate the combined(as a dual number and Quaternion) conjugation of the DualQuaternion

Source

pub fn norm(&self) -> Self

Calculate the norm of the DualQuaternion

Source

pub fn to_rotation_translation(&self) -> (M33<T>, V3<T>)

Get the underlying rotation and translation from the DualQuaternion

Source

pub fn get_translation(&self) -> V3<T>

Get the underlying translation from the DualQuaternion

Source

pub fn to_quaternion_translation(&self) -> (Quaternion<T>, V3<T>)

Get the underlying Quaternion and translation from the DualQuaternion

Source

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>

Source

pub fn new_from_vecs(q_real: &V4<T>, q_dual: &V4<T>) -> Self

Construct a new DualQuaternion from two V4

Source

pub fn zero() -> Self

construct a zero DualQuaternion

Source

pub fn one() -> DualQuaternion<T>

construct a unit DualQuaternion

Trait Implementations§

Source§

impl<T: Num + Copy> Add for DualQuaternion<T>

Source§

type Output = DualQuaternion<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self

Performs the + operation. Read more
Source§

impl<T: Clone> Clone for DualQuaternion<T>

Source§

fn clone(&self) -> DualQuaternion<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for DualQuaternion<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Num + Display> Display for DualQuaternion<T>

Source§

fn fmt(&self, dest: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Float + Signed> Div for DualQuaternion<T>

Source§

type Output = DualQuaternion<T>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Self) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: Num + Copy> Mul<T> for DualQuaternion<T>

Source§

type Output = DualQuaternion<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: T) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: Num + Copy> Mul for DualQuaternion<T>

Source§

type Output = DualQuaternion<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: Num + Copy + Signed> Neg for DualQuaternion<T>

Source§

type Output = DualQuaternion<T>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self

Performs the unary - operation. Read more
Source§

impl<T: Num + Copy> One for DualQuaternion<T>

Source§

fn one() -> Self

Create an identity DualQuaternion

Source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
Source§

fn is_one(&self) -> bool
where Self: PartialEq,

Returns true if self is equal to the multiplicative identity. Read more
Source§

impl<T: PartialEq> PartialEq for DualQuaternion<T>

Source§

fn eq(&self, other: &DualQuaternion<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Num + Copy> Sub for DualQuaternion<T>

Source§

type Output = DualQuaternion<T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self

Performs the - operation. Read more
Source§

impl<T: Num + Copy> Zero for DualQuaternion<T>

Source§

fn zero() -> Self

Returns the additive identity element of Self, 0. Read more
Source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
Source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
Source§

impl<T: Copy> Copy for DualQuaternion<T>

Source§

impl<T> StructuralPartialEq for DualQuaternion<T>

Auto Trait Implementations§

§

impl<T> Freeze for DualQuaternion<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for DualQuaternion<T>
where T: RefUnwindSafe,

§

impl<T> Send for DualQuaternion<T>
where T: Send,

§

impl<T> Sync for DualQuaternion<T>
where T: Sync,

§

impl<T> Unpin for DualQuaternion<T>
where T: Unpin,

§

impl<T> UnwindSafe for DualQuaternion<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.