Struct libreda_db::layout::prelude::Matrix2dTransform
pub struct Matrix2dTransform<T>where
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§
§impl<T> Matrix2dTransform<T>where
T: CoordinateType,
impl<T> Matrix2dTransform<T>where T: CoordinateType,
pub fn new(matrix: Matrix2d<T>) -> Matrix2dTransform<T>
pub fn new(matrix: Matrix2d<T>) -> Matrix2dTransform<T>
Create a new transform based on a matrix.
pub 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.
pub fn new_scaling(factor: T) -> Matrix2dTransform<T>
pub fn new_scaling(factor: T) -> Matrix2dTransform<T>
Create a scaling by a factor.
pub fn new_mirror_x() -> Matrix2dTransform<T>
pub fn new_mirror_x() -> Matrix2dTransform<T>
Mirror at the x-axis.
pub fn new_mirror_y() -> Matrix2dTransform<T>
pub fn new_mirror_y() -> Matrix2dTransform<T>
Mirror at the y-axis.
pub 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.
pub fn to_matrix2d(&self) -> Matrix2d<T>
pub fn to_matrix2d(&self) -> Matrix2d<T>
Return the matrix describing this transformation.
pub fn try_invert(&self) -> Option<Matrix2dTransform<T>>
pub fn try_invert(&self) -> Option<Matrix2dTransform<T>>
Get the inverse transformation.
Trait Implementations§
§impl<T> Clone for Matrix2dTransform<T>where
T: Clone + CoordinateType,
impl<T> Clone for Matrix2dTransform<T>where T: Clone + CoordinateType,
§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 more§impl<T> Debug for Matrix2dTransform<T>where
T: Debug + CoordinateType,
impl<T> Debug for Matrix2dTransform<T>where T: Debug + CoordinateType,
§impl<'de, T> Deserialize<'de> for Matrix2dTransform<T>where
T: CoordinateType + Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Matrix2dTransform<T>where T: CoordinateType + Deserialize<'de>,
§fn deserialize<__D>(
__deserializer: __D
) -> Result<Matrix2dTransform<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<Matrix2dTransform<T>, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl<T> Hash for Matrix2dTransform<T>where
T: Hash + CoordinateType,
impl<T> Hash for Matrix2dTransform<T>where T: Hash + CoordinateType,
§impl<T> PartialEq<Matrix2dTransform<T>> for Matrix2dTransform<T>where
T: PartialEq<T> + CoordinateType,
impl<T> PartialEq<Matrix2dTransform<T>> for Matrix2dTransform<T>where T: PartialEq<T> + CoordinateType,
§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 ==.§impl<T> Serialize for Matrix2dTransform<T>where
T: CoordinateType + Serialize,
impl<T> Serialize for Matrix2dTransform<T>where T: CoordinateType + Serialize,
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more