pub struct Matrix3dTransform<T: CoordinateType> {
pub m11: T,
pub m12: T,
pub m21: T,
pub m22: T,
pub m31: T,
pub m32: T,
}Expand description
Affine transformation represented as a 3x3 matrix like:
m11 m12 0
m21 m22 0
m31 m32 1Fields§
§m11: Tm11
m12: Tm12
m21: Tm21
m22: Tm22
m31: Tm31. Used to express the x component of the translation.
m32: Tm32. Used to express the y component of the translation.
Implementations§
Source§impl<T: CoordinateType> Matrix3dTransform<T>
impl<T: CoordinateType> Matrix3dTransform<T>
Sourcepub fn new(m11: T, m12: T, m21: T, m22: T, m31: T, m32: T) -> Self
pub fn new(m11: T, m12: T, m21: T, m22: T, m31: T, m32: T) -> Self
Create a new transform based on the matrix elements.
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_matrix3d(&self) -> Matrix3d<T>
pub fn to_matrix3d(&self) -> Matrix3d<T>
Return the 3x3 matrix describing this transformation.
Sourcepub fn to_matrix2d(&self) -> Matrix2d<T>
pub fn to_matrix2d(&self) -> Matrix2d<T>
Return the 2x2 matrix that describes this transformation without any translation.
Sourcepub fn determinant(&self) -> T
pub fn determinant(&self) -> T
Compute the determinant of the 3x3 matrix that describes this transformation.
Sourcepub fn try_invert(&self) -> Option<Self>
pub fn try_invert(&self) -> Option<Self>
Get the inverse transformation if it exists.
Sourcepub fn then(&self, t: &Self) -> Self
pub fn then(&self, t: &Self) -> Self
Return a new transformation that is equal to applying
first self then t.
Sourcepub fn then_scale(&self, factor: T) -> Self
pub fn then_scale(&self, factor: T) -> Self
Create a new transformation with an additional scaling.
Sourcepub fn then_translate<V: Into<Vector<T>>>(&self, v: V) -> Self
pub fn then_translate<V: Into<Vector<T>>>(&self, v: V) -> Self
Create a new transformation with an additional translation.
Sourcepub fn then_rotate90(&self, angle: Angle) -> Self
pub fn then_rotate90(&self, angle: Angle) -> Self
Create a new transformation with an additional rotation by a multiple of 90 degrees.
Sourcepub fn then_mirror_x(&self) -> Self
pub fn then_mirror_x(&self) -> Self
Create a new transformation with an additional mirroring at the x-axis.
Sourcepub fn then_mirror_y(&self) -> Self
pub fn then_mirror_y(&self) -> Self
Create a new transformation with an additional mirroring at the y-axis.
Sourcepub fn get_translation(&self) -> Vector<T>
pub fn get_translation(&self) -> Vector<T>
Get the translation part of this affine transformation.
Source§impl<T: CoordinateType + Float> Matrix3dTransform<T>
impl<T: CoordinateType + Float> Matrix3dTransform<T>
Sourcepub fn then_rotate(&self, phi: T) -> Self
pub fn then_rotate(&self, phi: T) -> Self
Create a new transformation with an additional rotation.
Trait Implementations§
Source§impl<T: Clone + CoordinateType> Clone for Matrix3dTransform<T>
impl<T: Clone + CoordinateType> Clone for Matrix3dTransform<T>
Source§fn clone(&self) -> Matrix3dTransform<T>
fn clone(&self) -> Matrix3dTransform<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T: Debug + CoordinateType> Debug for Matrix3dTransform<T>
impl<T: Debug + CoordinateType> Debug for Matrix3dTransform<T>
Source§impl<T: Hash + CoordinateType> Hash for Matrix3dTransform<T>
impl<T: Hash + CoordinateType> Hash for Matrix3dTransform<T>
Source§impl<T: CoordinateType> Mul for Matrix3dTransform<T>
impl<T: CoordinateType> Mul for Matrix3dTransform<T>
Source§impl<T: PartialEq + CoordinateType> PartialEq for Matrix3dTransform<T>
impl<T: PartialEq + CoordinateType> PartialEq for Matrix3dTransform<T>
impl<T: Eq + CoordinateType> Eq for Matrix3dTransform<T>
impl<T: CoordinateType> StructuralPartialEq for Matrix3dTransform<T>
Auto Trait Implementations§
impl<T> Freeze for Matrix3dTransform<T>where
T: Freeze,
impl<T> RefUnwindSafe for Matrix3dTransform<T>where
T: RefUnwindSafe,
impl<T> Send for Matrix3dTransform<T>where
T: Send,
impl<T> Sync for Matrix3dTransform<T>where
T: Sync,
impl<T> Unpin for Matrix3dTransform<T>where
T: Unpin,
impl<T> UnwindSafe for Matrix3dTransform<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
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