pub struct Rotation<From: Frame, To: Frame> { /* private fields */ }Expand description
A rotation from one frame to another.
PhantomData<fn(From) -> To> rather than PhantomData<(From, To)>: it gives
the correct variance and keeps Rotation unconditionally Send + Sync
regardless of the tag types, which are never values anyway.
Implementations§
Source§impl<From: Frame, To: Frame> Rotation<From, To>
impl<From: Frame, To: Frame> Rotation<From, To>
Sourcepub const fn from_matrix(matrix: Mat3) -> Self
pub const fn from_matrix(matrix: Mat3) -> Self
Wrap a matrix, asserting by construction which frames it connects.
The only place a frame claim is made rather than checked. Everything downstream is then checked by the compiler.
Two things are asserted here and not checked: the frames, and that the matrix
is a proper rotation. The second is not decoration —
derivations/frame_transform.mac shows Transform::inverse inverts
Transform::state only when det = +1, and misses by −2 ω × r when it is
−1. A reflection would typecheck.
Trait Implementations§
impl<From: Copy + Frame, To: Copy + Frame> Copy for Rotation<From, To>
impl<From: PartialEq + Frame, To: PartialEq + Frame> StructuralPartialEq for Rotation<From, To>
Auto Trait Implementations§
impl<From, To> Freeze for Rotation<From, To>
impl<From, To> RefUnwindSafe for Rotation<From, To>
impl<From, To> Send for Rotation<From, To>
impl<From, To> Sync for Rotation<From, To>
impl<From, To> Unpin for Rotation<From, To>
impl<From, To> UnsafeUnpin for Rotation<From, To>
impl<From, To> UnwindSafe for Rotation<From, To>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more