Struct iron_shapes::transform::Matrix2dTransform
source · pub struct Matrix2dTransform<T: CoordinateType> {
matrix: Matrix2d<T>,
}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.
Fields§
§matrix: Matrix2d<T>Implementations§
source§impl<T: CoordinateType> Matrix2dTransform<T>
impl<T: CoordinateType> Matrix2dTransform<T>
sourcepub fn new_rotation90(angle: Angle) -> Self
pub fn new_rotation90(angle: Angle) -> Self
Create a rotation by an integer multiple of 90 degrees.
sourcepub fn new_scaling(factor: T) -> Self
pub fn new_scaling(factor: T) -> Self
Create a scaling by a factor.
sourcepub fn new_mirror_x() -> Self
pub fn new_mirror_x() -> Self
Mirror at the x-axis.
sourcepub fn new_mirror_y() -> Self
pub fn new_mirror_y() -> Self
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<Self>
pub fn try_invert(&self) -> Option<Self>
Get the inverse transformation.
Trait Implementations§
source§impl<T: Clone + CoordinateType> Clone for Matrix2dTransform<T>
impl<T: Clone + CoordinateType> Clone for Matrix2dTransform<T>
source§fn clone(&self) -> Matrix2dTransform<T>
fn clone(&self) -> Matrix2dTransform<T>
Returns a copy 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 + CoordinateType> Debug for Matrix2dTransform<T>
impl<T: Debug + CoordinateType> Debug for Matrix2dTransform<T>
source§impl<'de, T> Deserialize<'de> for Matrix2dTransform<T>where
T: Deserialize<'de> + CoordinateType,
impl<'de, T> Deserialize<'de> for Matrix2dTransform<T>where T: Deserialize<'de> + CoordinateType,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<T: Hash + CoordinateType> Hash for Matrix2dTransform<T>
impl<T: Hash + CoordinateType> Hash for Matrix2dTransform<T>
source§impl<T: PartialEq + CoordinateType> PartialEq<Matrix2dTransform<T>> for Matrix2dTransform<T>
impl<T: PartialEq + CoordinateType> PartialEq<Matrix2dTransform<T>> for Matrix2dTransform<T>
source§fn eq(&self, other: &Matrix2dTransform<T>) -> bool
fn eq(&self, other: &Matrix2dTransform<T>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.