Struct libreda_pnr::db::Matrix2dTransform[]

pub struct Matrix2dTransform<T> where
    T: CoordinateType
{ /* fields omitted */ }

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

impl<T> Matrix2dTransform<T> where
    T: CoordinateType

pub fn new(matrix: Matrix2d<T>) -> Matrix2dTransform<T>

Create a new transform based on a matrix.

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>

Create a scaling by a factor.

pub fn new_mirror_x() -> Matrix2dTransform<T>

Mirror at the x-axis.

pub fn new_mirror_y() -> Matrix2dTransform<T>

Mirror at the y-axis.

pub fn transform_point(&self, p: Point<T>) -> Point<T>

Apply the transformation to a single point.

pub fn to_matrix2d(&self) -> Matrix2d<T>

Return the matrix describing this transformation.

pub fn try_invert(&self) -> Option<Matrix2dTransform<T>>

Get the inverse transformation.

Trait Implementations

impl<T> Clone for Matrix2dTransform<T> where
    T: CoordinateType + Clone

impl<T> Debug for Matrix2dTransform<T> where
    T: CoordinateType + Debug

impl<T> Hash for Matrix2dTransform<T> where
    T: CoordinateType + Hash

impl<T> PartialEq<Matrix2dTransform<T>> for Matrix2dTransform<T> where
    T: CoordinateType + PartialEq<T>, 

impl<T> StructuralPartialEq for Matrix2dTransform<T> where
    T: CoordinateType

Auto Trait Implementations

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.