pub struct Rotation2<S>(/* private fields */)
where
S: Ring + MaybeSerDes;Expand description
Orthogonal 2x2 matrix with determinant +1, i.e. a member of the circle group $SO(2)$ of special orthogonal matrices
Implementations§
Source§impl<S> Rotation2<S>where
S: Ring + MaybeSerDes,
impl<S> Rotation2<S>where
S: Ring + MaybeSerDes,
Sourcepub fn new(mat: Matrix2<S>) -> Option<Self>
pub fn new(mat: Matrix2<S>) -> Option<Self>
Returns None if called with a matrix that is not orthonormal with determinant
+1.
This method checks whether mat * mat^T == I and mat.determinant() == 1.
Sourcepub fn new_approx(mat: Matrix2<S>) -> Option<Self>where
S: RelativeEq<Epsilon = S>,
pub fn new_approx(mat: Matrix2<S>) -> Option<Self>where
S: RelativeEq<Epsilon = S>,
Returns None if called with a matrix that is not orthonormal with determinant
+1.
This method checks whether mat * mat^T == I and mat.determinant() == 1
(approximately using relative equality).
Sourcepub fn from_angle(angle: Rad<S>) -> Selfwhere
S: Real,
pub fn from_angle(angle: Rad<S>) -> Selfwhere
S: Real,
Create a rotation for the given angle
Sourcepub fn noisy(mat: Matrix2<S>) -> Selfwhere
S: Debug,
pub fn noisy(mat: Matrix2<S>) -> Selfwhere
S: Debug,
Panic if the given matrix is not orthogonal with determinant +1.
This method checks whether mat * mat^T == I and mat.determinant() == 1.
Sourcepub fn noisy_approx(mat: Matrix2<S>) -> Selfwhere
S: RelativeEq<Epsilon = S> + Debug,
pub fn noisy_approx(mat: Matrix2<S>) -> Selfwhere
S: RelativeEq<Epsilon = S> + Debug,
Panic if the given matrix is not orthogonal with determinant +1.
This method checks whether mat * mat^T == I and mat.determinant() == 1
(approximately using relative equality).
Sourcepub fn unchecked(mat: Matrix2<S>) -> Selfwhere
S: Debug,
pub fn unchecked(mat: Matrix2<S>) -> Selfwhere
S: Debug,
It is a debug panic if the given matrix is not orthogonal with determinant +1.
This method checks whether mat * mat^T == I and mat.determinant() == 1.
Sourcepub fn unchecked_approx(mat: Matrix2<S>) -> Selfwhere
S: RelativeEq<Epsilon = S> + Debug,
pub fn unchecked_approx(mat: Matrix2<S>) -> Selfwhere
S: RelativeEq<Epsilon = S> + Debug,
It is a debug panic if the given matrix is not orthogonal with determinant +1.
This method checks whether mat * mat^T == I and mat.determinant() == 1
(approximately using relative equality).
Sourcepub fn rotate_around(self, point: Point2<S>, center: Point2<S>) -> Point2<S>
pub fn rotate_around(self, point: Point2<S>, center: Point2<S>) -> Point2<S>
Rotate around a center point
Methods from Deref<Target = LinearAuto<S, Vector2<S>>>§
Sourcepub fn is_orthonormal(&self) -> bool
pub fn is_orthonormal(&self) -> bool
Returns false if called with a matrix that is not orthogonal with determinant +/-1.
This method checks whether mat * mat^T == I and mat.determinant() == +/-1.
Sourcepub fn is_orthonormal_approx(&self) -> bool
pub fn is_orthonormal_approx(&self) -> bool
Returns None if called with a matrix that is not orthogonal with determinant
+/-1.
This method checks whether mat * mat^T == I and mat.determinant() == +/-1
(approximately using relative equality).
Sourcepub fn is_rotation(&self) -> bool
pub fn is_rotation(&self) -> bool
Checks whether the transformation is a special orthogonal matrix.
This method checks whether mat * mat^T == I and mat.determinant() == 1.
Sourcepub fn is_rotation_approx(&self) -> bool
pub fn is_rotation_approx(&self) -> bool
Checks whether the transformation is a special orthogonal matrix.
This method checks whether mat * mat^T == I and mat.determinant() == 1
(approximately using relative equality).
Trait Implementations§
Source§impl<S> DivAssign for Rotation2<S>where
S: Ring + MaybeSerDes,
impl<S> DivAssign for Rotation2<S>where
S: Ring + MaybeSerDes,
Source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
/= operation. Read moreSource§impl<S> MulAssign for Rotation2<S>where
S: Ring + MaybeSerDes,
impl<S> MulAssign for Rotation2<S>where
S: Ring + MaybeSerDes,
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
*= operation. Read moreimpl<S> Copy for Rotation2<S>
impl<S> StructuralPartialEq for Rotation2<S>where
S: Ring + MaybeSerDes,
Auto Trait Implementations§
impl<S> Freeze for Rotation2<S>where
S: Freeze,
impl<S> RefUnwindSafe for Rotation2<S>where
S: RefUnwindSafe,
impl<S> Send for Rotation2<S>where
S: Send,
impl<S> Sync for Rotation2<S>where
S: Sync,
impl<S> Unpin for Rotation2<S>where
S: Unpin,
impl<S> UnwindSafe for Rotation2<S>where
S: UnwindSafe,
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more