Struct Mat2d

Source
pub struct Mat2d { /* private fields */ }

Implementations§

Source§

impl Mat2d

Source

pub fn new(x_axis: Vec2d, y_axis: Vec2d) -> Self

Source

pub fn zero() -> Self

Source

pub fn identity() -> Self

Source§

impl Mat2d

Source

pub fn col(&self, index: usize) -> Vec2d

Source

pub fn row(&self, index: usize) -> Vec2d

Source

pub fn is_nan(&self) -> bool

Source

pub fn is_infinite(&self) -> bool

Source

pub fn is_finite(&self) -> bool

Source

pub fn transpose(&self) -> Self

Source

pub fn determinant(&self) -> f64

Source

pub fn inverse(&self) -> Self

Source

pub fn try_inverse(&self) -> Option<Self>

Source§

impl Mat2d

Source

pub fn from_array(m: [f64; 4]) -> Self

Source

pub fn from_array_2d(m: [[f64; 2]; 2]) -> Self

Source

pub fn from_diagonal(diagonal: Vec2d) -> Self

Source§

impl Mat2d

Source

pub fn to_array(self) -> [f64; 4]

Source

pub fn to_array_2d(self) -> [[f64; 2]; 2]

Source

pub fn to_mat3d(self) -> Mat3d

Source

pub fn to_mat4d(self) -> Mat4d

Source

pub fn to_mat2f(self) -> Mat2f

Trait Implementations§

Source§

impl Add<Mat2d> for f64

Source§

type Output = Mat2d

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl Add<f64> for Mat2d

Source§

type Output = Mat2d

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl Add for Mat2d

Source§

type Output = Mat2d

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl AddAssign<f64> for Mat2d

Source§

fn add_assign(&mut self, rhs: f64)

Performs the += operation. Read more
Source§

impl AddAssign for Mat2d

Source§

fn add_assign(&mut self, rhs: Mat2d)

Performs the += operation. Read more
Source§

impl Clone for Mat2d

Source§

fn clone(&self) -> Mat2d

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Mat2d

Source§

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

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

impl Default for Mat2d

Source§

fn default() -> Self

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

impl Display for Mat2d

Source§

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

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

impl Div<f64> for Mat2d

Source§

type Output = Mat2d

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f64) -> Self::Output

Performs the / operation. Read more
Source§

impl DivAssign<f64> for Mat2d

Source§

fn div_assign(&mut self, rhs: f64)

Performs the /= operation. Read more
Source§

impl From<Mat2d> for Mat3d

Source§

fn from(m: Mat2d) -> Self

Converts to this type from the input type.
Source§

impl From<Mat2d> for Mat4d

Source§

fn from(m: Mat2d) -> Self

Converts to this type from the input type.
Source§

impl From<Mat3d> for Mat2d

Source§

fn from(m: Mat3d) -> Self

Converts to this type from the input type.
Source§

impl From<Mat4d> for Mat2d

Source§

fn from(m: Mat4d) -> Self

Converts to this type from the input type.
Source§

impl Index<usize> for Mat2d

Source§

type Output = Vec2d

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl IndexMut<usize> for Mat2d

Source§

fn index_mut(&mut self, index: usize) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl Mul<Mat2d> for f64

Source§

type Output = Mat2d

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl Mul<Vec2d> for Mat2d

Source§

type Output = Vec2d

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl Mul<f64> for Mat2d

Source§

type Output = Mat2d

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl Mul for Mat2d

Source§

type Output = Mat2d

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl MulAssign<f64> for Mat2d

Source§

fn mul_assign(&mut self, rhs: f64)

Performs the *= operation. Read more
Source§

impl MulAssign for Mat2d

Source§

fn mul_assign(&mut self, rhs: Mat2d)

Performs the *= operation. Read more
Source§

impl PartialEq for Mat2d

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Sub<Mat2d> for f64

Source§

type Output = Mat2d

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl Sub<f64> for Mat2d

Source§

type Output = Mat2d

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl Sub for Mat2d

Source§

type Output = Mat2d

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl SubAssign<f64> for Mat2d

Source§

fn sub_assign(&mut self, rhs: f64)

Performs the -= operation. Read more
Source§

impl SubAssign for Mat2d

Source§

fn sub_assign(&mut self, rhs: Mat2d)

Performs the -= operation. Read more
Source§

impl Copy for Mat2d

Source§

impl StructuralPartialEq for Mat2d

Auto Trait Implementations§

§

impl Freeze for Mat2d

§

impl RefUnwindSafe for Mat2d

§

impl Send for Mat2d

§

impl Sync for Mat2d

§

impl Unpin for Mat2d

§

impl UnwindSafe for Mat2d

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.