[−][src]Struct nalgebra::geometry::DualQuaternion
A dual quaternion.
Indexing
DualQuaternions are stored as [..real, ..dual].
Both of the quaternion components are laid out in i, j, k, w
order.
let real = Quaternion::new(1.0, 2.0, 3.0, 4.0); let dual = Quaternion::new(5.0, 6.0, 7.0, 8.0); let dq = DualQuaternion::from_real_and_dual(real, dual); assert_eq!(dq[0], 2.0); assert_eq!(dq[1], 3.0); assert_eq!(dq[4], 6.0); assert_eq!(dq[7], 5.0);
NOTE: As of December 2020, dual quaternion support is a work in progress. If a feature that you need is missing, feel free to open an issue or a PR. See https://github.com/dimforge/nalgebra/issues/487
Fields
real: Quaternion<N>
The real component of the quaternion
dual: Quaternion<N>
The dual component of the quaternion
Implementations
impl<N: SimdRealField> DualQuaternion<N> where
N::Element: SimdRealField,
[src]
N::Element: SimdRealField,
#[must_use = "Did you mean to use normalize_mut()?"]pub fn normalize(&self) -> Self
[src]
Normalizes this quaternion.
Example
let real = Quaternion::new(1.0, 2.0, 3.0, 4.0); let dual = Quaternion::new(5.0, 6.0, 7.0, 8.0); let dq = DualQuaternion::from_real_and_dual(real, dual); let dq_normalized = dq.normalize(); relative_eq!(dq_normalized.real.norm(), 1.0);
pub fn normalize_mut(&mut self)
[src]
Normalizes this quaternion.
Example
let real = Quaternion::new(1.0, 2.0, 3.0, 4.0); let dual = Quaternion::new(5.0, 6.0, 7.0, 8.0); let mut dq = DualQuaternion::from_real_and_dual(real, dual); dq.normalize_mut(); relative_eq!(dq.real.norm(), 1.0);
impl<N: SimdRealField> DualQuaternion<N>
[src]
pub fn from_real_and_dual(real: Quaternion<N>, dual: Quaternion<N>) -> Self
[src]
Creates a dual quaternion from its rotation and translation components.
Example
let rot = Quaternion::new(1.0, 2.0, 3.0, 4.0); let trans = Quaternion::new(5.0, 6.0, 7.0, 8.0); let dq = DualQuaternion::from_real_and_dual(rot, trans); assert_eq!(dq.real.w, 1.0);
pub fn identity() -> Self
[src]
The dual quaternion multiplicative identity
Example
let dq1 = DualQuaternion::identity(); let dq2 = DualQuaternion::from_real_and_dual( Quaternion::new(1.,2.,3.,4.), Quaternion::new(5.,6.,7.,8.) ); assert_eq!(dq1 * dq2, dq2); assert_eq!(dq2 * dq1, dq2);
Trait Implementations
impl<N: SimdRealField> Add<DualQuaternion<N>> for DualQuaternion<N> where
N::Element: SimdRealField,
[src]
N::Element: SimdRealField,
type Output = DualQuaternion<N>
The resulting type after applying the +
operator.
fn add(self, rhs: DualQuaternion<N>) -> Self::Output
[src]
impl<N: SimdRealField> AsMut<[N; 8]> for DualQuaternion<N>
[src]
impl<N: SimdRealField> AsRef<[N; 8]> for DualQuaternion<N>
[src]
impl<N: Clone + SimdRealField> Clone for DualQuaternion<N>
[src]
fn clone(&self) -> DualQuaternion<N>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<N: Copy + SimdRealField> Copy for DualQuaternion<N>
[src]
impl<N: Debug + SimdRealField> Debug for DualQuaternion<N>
[src]
impl<N: Default + SimdRealField> Default for DualQuaternion<N>
[src]
fn default() -> DualQuaternion<N>
[src]
impl<N: Eq + SimdRealField> Eq for DualQuaternion<N>
[src]
impl<N: SimdRealField> Index<usize> for DualQuaternion<N>
[src]
impl<N: SimdRealField> IndexMut<usize> for DualQuaternion<N>
[src]
impl<N: SimdRealField> Mul<DualQuaternion<N>> for DualQuaternion<N> where
N::Element: SimdRealField,
[src]
N::Element: SimdRealField,
type Output = DualQuaternion<N>
The resulting type after applying the *
operator.
fn mul(self, rhs: Self) -> Self::Output
[src]
impl<N: SimdRealField> Mul<N> for DualQuaternion<N> where
N::Element: SimdRealField,
[src]
N::Element: SimdRealField,
type Output = DualQuaternion<N>
The resulting type after applying the *
operator.
fn mul(self, rhs: N) -> Self::Output
[src]
impl<N: PartialEq + SimdRealField> PartialEq<DualQuaternion<N>> for DualQuaternion<N>
[src]
fn eq(&self, other: &DualQuaternion<N>) -> bool
[src]
fn ne(&self, other: &DualQuaternion<N>) -> bool
[src]
impl<N: SimdRealField> StructuralEq for DualQuaternion<N>
[src]
impl<N: SimdRealField> StructuralPartialEq for DualQuaternion<N>
[src]
impl<N: SimdRealField> Sub<DualQuaternion<N>> for DualQuaternion<N> where
N::Element: SimdRealField,
[src]
N::Element: SimdRealField,
type Output = DualQuaternion<N>
The resulting type after applying the -
operator.
fn sub(self, rhs: DualQuaternion<N>) -> Self::Output
[src]
Auto Trait Implementations
impl<N> RefUnwindSafe for DualQuaternion<N> where
N: RefUnwindSafe,
[src]
N: RefUnwindSafe,
impl<N> Send for DualQuaternion<N>
[src]
impl<N> Sync for DualQuaternion<N>
[src]
impl<N> Unpin for DualQuaternion<N> where
N: Unpin,
[src]
N: Unpin,
impl<N> UnwindSafe for DualQuaternion<N> where
N: UnwindSafe,
[src]
N: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
[src]
pub fn is_in_subset(&self) -> bool
[src]
pub fn to_subset_unchecked(&self) -> SS
[src]
pub fn from_subset(element: &SS) -> SP
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,