[−][src]Struct nanachi::matrix::Matrix2d
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
impl RefUnwindSafe for Matrix2d
impl Send for Matrix2d
impl Sync for Matrix2d
impl Unpin for Matrix2d
impl UnwindSafe for Matrix2d
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
pub fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,