Struct rin::math::geometry::DualQuaternion [−][src]
#[repr(C)]pub struct DualQuaternion<N> where
N: SimdRealField, { pub real: Quaternion<N>, pub dual: Quaternion<N>, }
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> DualQuaternion<N> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
[src]
impl<N> DualQuaternion<N> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
[src]#[must_use = "Did you mean to use normalize_mut()?"]pub fn normalize(&self) -> DualQuaternion<N>
[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> DualQuaternion<N> where
N: SimdRealField,
[src]
impl<N> DualQuaternion<N> where
N: SimdRealField,
[src]pub fn from_real_and_dual(
real: Quaternion<N>,
dual: Quaternion<N>
) -> DualQuaternion<N>
[src]
real: Quaternion<N>,
dual: Quaternion<N>
) -> DualQuaternion<N>
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() -> DualQuaternion<N>
[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> Add<DualQuaternion<N>> for DualQuaternion<N> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
[src]
impl<N> Add<DualQuaternion<N>> for DualQuaternion<N> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
[src]type Output = DualQuaternion<N>
The resulting type after applying the +
operator.
pub fn add(
self,
rhs: DualQuaternion<N>
) -> <DualQuaternion<N> as Add<DualQuaternion<N>>>::Output
[src]
self,
rhs: DualQuaternion<N>
) -> <DualQuaternion<N> as Add<DualQuaternion<N>>>::Output
impl<N> AsMut<[N; 8]> for DualQuaternion<N> where
N: SimdRealField,
[src]
impl<N> AsMut<[N; 8]> for DualQuaternion<N> where
N: SimdRealField,
[src]impl<N> AsRef<[N; 8]> for DualQuaternion<N> where
N: SimdRealField,
[src]
impl<N> AsRef<[N; 8]> for DualQuaternion<N> where
N: SimdRealField,
[src]impl<N> Clone for DualQuaternion<N> where
N: Clone + SimdRealField,
[src]
impl<N> Clone for DualQuaternion<N> where
N: Clone + SimdRealField,
[src]pub fn clone(&self) -> DualQuaternion<N>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<N> Debug for DualQuaternion<N> where
N: Debug + SimdRealField,
[src]
impl<N> Debug for DualQuaternion<N> where
N: Debug + SimdRealField,
[src]impl<N> Default for DualQuaternion<N> where
N: Default + SimdRealField,
[src]
impl<N> Default for DualQuaternion<N> where
N: Default + SimdRealField,
[src]pub fn default() -> DualQuaternion<N>
[src]
impl<'a, N> Deserialize<'a> for DualQuaternion<N> where
N: SimdRealField + Deserialize<'a>,
[src]
impl<'a, N> Deserialize<'a> for DualQuaternion<N> where
N: SimdRealField + Deserialize<'a>,
[src]pub fn deserialize<Des>(
deserializer: Des
) -> Result<DualQuaternion<N>, <Des as Deserializer<'a>>::Error> where
Des: Deserializer<'a>,
[src]
deserializer: Des
) -> Result<DualQuaternion<N>, <Des as Deserializer<'a>>::Error> where
Des: Deserializer<'a>,
impl<N> Index<usize> for DualQuaternion<N> where
N: SimdRealField,
[src]
impl<N> Index<usize> for DualQuaternion<N> where
N: SimdRealField,
[src]impl<N> IndexMut<usize> for DualQuaternion<N> where
N: SimdRealField,
[src]
impl<N> IndexMut<usize> for DualQuaternion<N> where
N: SimdRealField,
[src]impl<N> Mul<DualQuaternion<N>> for DualQuaternion<N> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
[src]
impl<N> Mul<DualQuaternion<N>> for DualQuaternion<N> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
[src]type Output = DualQuaternion<N>
The resulting type after applying the *
operator.
pub fn mul(
self,
rhs: DualQuaternion<N>
) -> <DualQuaternion<N> as Mul<DualQuaternion<N>>>::Output
[src]
self,
rhs: DualQuaternion<N>
) -> <DualQuaternion<N> as Mul<DualQuaternion<N>>>::Output
impl<N> Mul<N> for DualQuaternion<N> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
[src]
impl<N> Mul<N> for DualQuaternion<N> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
[src]type Output = DualQuaternion<N>
The resulting type after applying the *
operator.
pub fn mul(self, rhs: N) -> <DualQuaternion<N> as Mul<N>>::Output
[src]
impl<N> PartialEq<DualQuaternion<N>> for DualQuaternion<N> where
N: PartialEq<N> + SimdRealField,
[src]
impl<N> PartialEq<DualQuaternion<N>> for DualQuaternion<N> where
N: PartialEq<N> + SimdRealField,
[src]pub fn eq(&self, other: &DualQuaternion<N>) -> bool
[src]
pub fn ne(&self, other: &DualQuaternion<N>) -> bool
[src]
impl<N> Serialize for DualQuaternion<N> where
N: SimdRealField + Serialize,
[src]
impl<N> Serialize for DualQuaternion<N> where
N: SimdRealField + Serialize,
[src]pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
impl<N> Sub<DualQuaternion<N>> for DualQuaternion<N> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
[src]
impl<N> Sub<DualQuaternion<N>> for DualQuaternion<N> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
[src]type Output = DualQuaternion<N>
The resulting type after applying the -
operator.
pub fn sub(
self,
rhs: DualQuaternion<N>
) -> <DualQuaternion<N> as Sub<DualQuaternion<N>>>::Output
[src]
self,
rhs: DualQuaternion<N>
) -> <DualQuaternion<N> as Sub<DualQuaternion<N>>>::Output
impl<N> Copy for DualQuaternion<N> where
N: Copy + SimdRealField,
[src]
N: Copy + SimdRealField,
impl<N> Eq for DualQuaternion<N> where
N: Eq + SimdRealField,
[src]
N: Eq + SimdRealField,
impl<N> StructuralEq for DualQuaternion<N> where
N: SimdRealField,
[src]
N: SimdRealField,
impl<N> StructuralPartialEq for DualQuaternion<N> where
N: SimdRealField,
[src]
N: SimdRealField,
Auto Trait Implementations
impl<N> RefUnwindSafe for DualQuaternion<N> where
N: RefUnwindSafe,
N: RefUnwindSafe,
impl<N> Send for DualQuaternion<N>
impl<N> Sync for DualQuaternion<N>
impl<N> Unpin for DualQuaternion<N> where
N: Unpin,
N: Unpin,
impl<N> UnwindSafe for DualQuaternion<N> where
N: UnwindSafe,
N: UnwindSafe,
Blanket Implementations
impl<T> DowncastSync for T where
T: Any + Send + Sync,
[src]
impl<T> DowncastSync for T where
T: Any + Send + Sync,
[src]impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> Serialize for T where
T: Serialize + ?Sized,
[src]
impl<T> Serialize for T where
T: Serialize + ?Sized,
[src]pub fn erased_serialize(
&self,
serializer: &mut dyn Serializer
) -> Result<Ok, Error>
[src]
&self,
serializer: &mut dyn Serializer
) -> Result<Ok, Error>
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]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<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]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> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> Slottable for T where
T: Copy,
[src]
T: Copy,