Skip to main content

Matrix3x2

Struct Matrix3x2 

Source
#[repr(C)]
pub struct Matrix3x2 { pub m11: f32, pub m12: f32, pub m21: f32, pub m22: f32, pub m31: f32, pub m32: f32, }

Fields§

§m11: f32§m12: f32§m21: f32§m22: f32§m31: f32§m32: f32

Implementations§

Source§

impl Matrix3x2

Source

pub const fn identity() -> Self

Returns the identity matrix (no transform).

Source

pub const fn translation(x: f32, y: f32) -> Self

Returns a matrix that translates by (x, y).

Source

pub fn rotation(angle: f32) -> Self

Returns a matrix that rotates by angle degrees about the origin.

Source

pub fn rotation_around(angle: f32, center: Vector2) -> Self

Returns a matrix that rotates by angle degrees about center.

Source

pub fn scale(scale_x: f32, scale_y: f32) -> Self

Returns a matrix that scales by scale_x and scale_y about the origin.

Source

pub fn scale_around(scale_x: f32, scale_y: f32, center: Vector2) -> Self

Returns a matrix that scales by scale_x and scale_y about center.

Source

pub fn skew(angle_x: f32, angle_y: f32) -> Self

Returns a matrix that skews by angle_x and angle_y degrees about the origin.

Source

pub fn skew_around(angle_x: f32, angle_y: f32, center: Vector2) -> Self

Returns a matrix that skews by angle_x and angle_y degrees about center.

Trait Implementations§

Source§

impl Add for Matrix3x2

Source§

type Output = Matrix3x2

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self

Performs the + operation. Read more
Source§

impl Add<&Matrix3x2> for Matrix3x2

Source§

type Output = Matrix3x2

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Self) -> Self

Performs the + operation. Read more
Source§

impl Add<&Matrix3x2> for &Matrix3x2

Source§

type Output = Matrix3x2

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Matrix3x2) -> Matrix3x2

Performs the + operation. Read more
Source§

impl Add<Matrix3x2> for &Matrix3x2

Source§

type Output = Matrix3x2

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Matrix3x2) -> Matrix3x2

Performs the + operation. Read more
Source§

impl Clone for Matrix3x2

Source§

fn clone(&self) -> Matrix3x2

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Matrix3x2

Source§

impl Debug for Matrix3x2

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Matrix3x2

Source§

fn default() -> Matrix3x2

Returns the “default value” for a type. Read more
Source§

impl Mul for Matrix3x2

Source§

type Output = Matrix3x2

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self

Performs the * operation. Read more
Source§

impl Mul<&Matrix3x2> for Matrix3x2

Source§

type Output = Matrix3x2

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Self) -> Self

Performs the * operation. Read more
Source§

impl Mul<&Matrix3x2> for &Matrix3x2

Source§

type Output = Matrix3x2

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Matrix3x2) -> Matrix3x2

Performs the * operation. Read more
Source§

impl Mul<Matrix3x2> for &Matrix3x2

Source§

type Output = Matrix3x2

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Matrix3x2) -> Matrix3x2

Performs the * operation. Read more
Source§

impl Mul<f32> for Matrix3x2

Source§

type Output = Matrix3x2

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f32) -> Self

Performs the * operation. Read more
Source§

impl Mul<f32> for &Matrix3x2

Source§

type Output = Matrix3x2

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f32) -> Matrix3x2

Performs the * operation. Read more
Source§

impl PartialEq for Matrix3x2

Source§

fn eq(&self, other: &Matrix3x2) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Matrix3x2

Source§

impl Sub for Matrix3x2

Source§

type Output = Matrix3x2

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self

Performs the - operation. Read more
Source§

impl Sub<&Matrix3x2> for Matrix3x2

Source§

type Output = Matrix3x2

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Self) -> Self

Performs the - operation. Read more
Source§

impl Sub<&Matrix3x2> for &Matrix3x2

Source§

type Output = Matrix3x2

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Matrix3x2) -> Matrix3x2

Performs the - operation. Read more
Source§

impl Sub<Matrix3x2> for &Matrix3x2

Source§

type Output = Matrix3x2

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Matrix3x2) -> Matrix3x2

Performs the - operation. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.