pub struct Matrix2dTransform<T>where
T: CoordinateType,{ /* private fields */ }
Expand description
Description of a transformation in the euclidean plane by a 2x2 matrix A
.
Transforming a point p
is computed by the matrix product A*p
.
Implementations§
Source§impl<T> Matrix2dTransform<T>where
T: CoordinateType,
impl<T> Matrix2dTransform<T>where
T: CoordinateType,
Sourcepub fn new(matrix: Matrix2d<T>) -> Matrix2dTransform<T>
pub fn new(matrix: Matrix2d<T>) -> Matrix2dTransform<T>
Create a new transform based on a matrix.
Sourcepub fn new_rotation90(angle: Angle) -> Matrix2dTransform<T>
pub fn new_rotation90(angle: Angle) -> Matrix2dTransform<T>
Create a rotation by an integer multiple of 90 degrees.
Sourcepub fn new_scaling(factor: T) -> Matrix2dTransform<T>
pub fn new_scaling(factor: T) -> Matrix2dTransform<T>
Create a scaling by a factor.
Sourcepub fn new_mirror_x() -> Matrix2dTransform<T>
pub fn new_mirror_x() -> Matrix2dTransform<T>
Mirror at the x-axis.
Sourcepub fn new_mirror_y() -> Matrix2dTransform<T>
pub fn new_mirror_y() -> Matrix2dTransform<T>
Mirror at the y-axis.
Sourcepub fn transform_point(&self, p: Point<T>) -> Point<T>
pub fn transform_point(&self, p: Point<T>) -> Point<T>
Apply the transformation to a single point.
Sourcepub fn to_matrix2d(&self) -> Matrix2d<T>
pub fn to_matrix2d(&self) -> Matrix2d<T>
Return the matrix describing this transformation.
Sourcepub fn try_invert(&self) -> Option<Matrix2dTransform<T>>
pub fn try_invert(&self) -> Option<Matrix2dTransform<T>>
Get the inverse transformation.
Trait Implementations§
Source§impl<T> Clone for Matrix2dTransform<T>where
T: Clone + CoordinateType,
impl<T> Clone for Matrix2dTransform<T>where
T: Clone + CoordinateType,
Source§fn clone(&self) -> Matrix2dTransform<T>
fn clone(&self) -> Matrix2dTransform<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T> Debug for Matrix2dTransform<T>where
T: Debug + CoordinateType,
impl<T> Debug for Matrix2dTransform<T>where
T: Debug + CoordinateType,
Source§impl<T> Hash for Matrix2dTransform<T>where
T: Hash + CoordinateType,
impl<T> Hash for Matrix2dTransform<T>where
T: Hash + CoordinateType,
Source§impl<T> PartialEq for Matrix2dTransform<T>where
T: PartialEq + CoordinateType,
impl<T> PartialEq for Matrix2dTransform<T>where
T: PartialEq + CoordinateType,
impl<T> Eq for Matrix2dTransform<T>where
T: Eq + CoordinateType,
impl<T> StructuralPartialEq for Matrix2dTransform<T>where
T: CoordinateType,
Auto Trait Implementations§
impl<T> Freeze for Matrix2dTransform<T>where
T: Freeze,
impl<T> RefUnwindSafe for Matrix2dTransform<T>where
T: RefUnwindSafe,
impl<T> Send for Matrix2dTransform<T>where
T: Send,
impl<T> Sync for Matrix2dTransform<T>where
T: Sync,
impl<T> Unpin for Matrix2dTransform<T>where
T: Unpin,
impl<T> UnwindSafe for Matrix2dTransform<T>where
T: 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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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