[][src]Struct nanachi::matrix::Matrix2d

pub struct Matrix2d(pub [f64; 6]);

Matrix for affine transformation.

Implementations

impl Matrix2d[src]

pub fn new() -> Matrix2d[src]

Create a Matrix2d that no transform.

pub fn translate(&self, x: f64, y: f64) -> Matrix2d[src]

Create new Matrix2d translated with specified position from myself.

pub fn scale(&self, x: f64, y: f64) -> Matrix2d[src]

Create new Matrix2d scaled with specified size from myself.

pub fn rotate(&self, rad: f64) -> Matrix2d[src]

Create new Matrix2d rotated with specified angle from myself.

pub fn skew_y(&self, dy: f64) -> Matrix2d[src]

Create new Matrix2d skewed with specified y-axis amount from myself.

pub fn skew_x(&self, dx: f64) -> Matrix2d[src]

Create new Matrix2d skewed with specified x-axis amount from myself.

pub fn apply<P: From<Point> + Into<Point>>(&self, p: P) -> P[src]

Transform the Point.

pub fn inverse(&self) -> Matrix2d[src]

Inverse the matrix Ideally, matrix2d.inverse().inverse() == matrix2d.

pub fn then(&self, rhs: &Matrix2d) -> Matrix2d[src]

Return the multiplication of the two matrices.

pub fn is_unit(&self) -> bool[src]

Return whether it is unit matrix.

pub fn is_direct(&self) -> bool[src]

Return whether it is directly or indirectly. An indirect matrix makes path flip.

Trait Implementations

impl Clone for Matrix2d[src]

impl Copy for Matrix2d[src]

impl Debug for Matrix2d[src]

impl Default for Matrix2d[src]

impl PartialEq<Matrix2d> for Matrix2d[src]

impl StructuralPartialEq for Matrix2d[src]

Auto Trait Implementations

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> SetParameter for T

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.