From 0ecbed512bb0a665cd5f3548b502cc8e843ccdc0 Mon Sep 17 00:00:00 2001 From: Terence Date: Sat, 20 Nov 2021 09:12:45 -0500 Subject: [PATCH] cargo fmt --- src/geometry/dual_quaternion.rs | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/geometry/dual_quaternion.rs b/src/geometry/dual_quaternion.rs index a001d332..e597cbf5 100644 --- a/src/geometry/dual_quaternion.rs +++ b/src/geometry/dual_quaternion.rs @@ -57,7 +57,10 @@ impl PartialEq for DualQuaternion { impl Default for DualQuaternion { fn default() -> Self { - Self { real: Quaternion::default(), dual: Quaternion::default() } + Self { + real: Quaternion::default(), + dual: Quaternion::default(), + } } } @@ -472,7 +475,9 @@ where #[inline] #[must_use = "Did you mean to use inverse_mut()?"] pub fn inverse(&self) -> Self { - let real = Unit::new_unchecked(self.as_ref().real.clone()).inverse().into_inner(); + let real = Unit::new_unchecked(self.as_ref().real.clone()) + .inverse() + .into_inner(); let dual = -real.clone() * self.as_ref().dual.clone() * real.clone(); UnitDualQuaternion::new_unchecked(DualQuaternion { real, dual }) } @@ -494,7 +499,9 @@ where #[inline] pub fn inverse_mut(&mut self) { let quat = self.as_mut_unchecked(); - quat.real = Unit::new_unchecked(quat.real.clone()).inverse().into_inner(); + quat.real = Unit::new_unchecked(quat.real.clone()) + .inverse() + .into_inner(); quat.dual = -quat.real.clone() * quat.dual.clone() * quat.real.clone(); } @@ -661,8 +668,11 @@ where let norm_squared = difference.real.vector().norm_squared(); if relative_eq!(norm_squared, T::zero(), epsilon = epsilon) { return Some(Self::from_parts( - self.translation().vector.lerp(&other.translation().vector, t).into(), - self.rotation() + self.translation() + .vector + .lerp(&other.translation().vector, t) + .into(), + self.rotation(), )); } @@ -675,8 +685,7 @@ where let mut pitch = -two * difference.dual.scalar() * inverse_norm.clone(); let direction = difference.real.vector() * inverse_norm.clone(); let moment = (difference.dual.vector() - - direction.clone() - * (pitch.clone() * difference.real.scalar() * half.clone())) + - direction.clone() * (pitch.clone() * difference.real.scalar() * half.clone())) * inverse_norm; angle *= t.clone(); @@ -974,7 +983,8 @@ impl> RelativeEq for UnitDualQuaternion bool { - self.as_ref().relative_eq(other.as_ref(), epsilon, max_relative) + self.as_ref() + .relative_eq(other.as_ref(), epsilon, max_relative) } }