Struct Matrix33

Source
#[repr(C)]
pub struct Matrix33<T>
where T: Real,
{ pub x: [T; 9], }
Expand description

3x3 Matrix type over Real

Fields§

§x: [T; 9]

Implementations§

Source§

impl<T> Matrix33<T>
where T: Real,

Source

pub fn make_identity() -> Matrix33<T>

Return a new identity matrix

Source

pub fn new(values: [T; 9]) -> Matrix33<T>

Return a new matrix initialized with the values passed

Source

pub fn equal_with_abs_error(self, other: &Matrix33<T>, e: T) -> bool

Compare 2 matrices for equality with absolute tolerance e

Source

pub fn equal_with_rel_error(self, other: &Matrix33<T>, e: T) -> bool

Compare 2 matrices for equality with relative tolerance e

Source

pub fn translate(t: Vec2<T>) -> Matrix33<T>
where T: Real,

Returns a new matrix specifying a translation of t

Source

pub fn scale(s: Vec2<T>) -> Matrix33<T>
where T: Real,

Returns a new matrix specifying a scale of s

Source

pub fn rotate(r: T) -> Matrix33<T>
where T: Real,

Returns a new matrix specifying a rotation of r

Source

pub fn transposed(self) -> Matrix33<T>

Return the transpose of this matrix

Source

pub fn determinant(self) -> T

Return the determinant of this matrix

Source

pub fn transformp(self, v: Vec2<T>) -> Vec2<T>

Transform the Vec2 v as a point

Source

pub fn transformv(self, v: Vec2<T>) -> Vec2<T>

Transform the Vec2 v as a vector

Source

pub fn mult_vec_matrix(self, v: Vec2<T>) -> Vec2<T>

Wrapper for Imath’s confusingly named convention for matrix * point

Source

pub fn mult_dir_matrix(self, v: Vec2<T>) -> Vec2<T>

Wrapper for Imath’s confusingly named convention for matrix * vector

Source

pub fn gj_inverse(self) -> Option<Matrix33<T>>

Gauss-Jordan matrix inversion

Source

pub fn inverse(self) -> Option<Matrix33<T>>

Matrix inverse

Trait Implementations§

Source§

impl<T> Add<T> for Matrix33<T>
where T: Real,

Source§

type Output = Matrix33<T>

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl<T> Clone for Matrix33<T>
where T: Real + Clone,

Source§

fn clone(&self) -> Matrix33<T>

Returns a copy 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<T> Debug for Matrix33<T>
where T: Real + Debug,

Source§

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

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

impl<T> Div<T> for Matrix33<T>
where T: Real,

Source§

type Output = Matrix33<T>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: T) -> Self

Performs the / operation. Read more
Source§

impl<T> Index<usize> for Matrix33<T>
where T: Real,

Index operator. Returns a slice of the underlying matrix to allow m[i][j] indexing

Source§

type Output = [T]

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &[T]

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

impl<T> IndexMut<usize> for Matrix33<T>
where T: Real,

Mutable Index operator. Returns a slice of the underlying matrix to allow m[i][j] indexing

Source§

fn index_mut(&mut self, index: usize) -> &mut [T]

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

impl<T> Mul<T> for Matrix33<T>
where T: Real,

Source§

type Output = Matrix33<T>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl<T> Mul for Matrix33<T>
where T: Real,

Source§

type Output = Matrix33<T>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl<T> Neg for Matrix33<T>
where T: Real,

Source§

type Output = Matrix33<T>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self

Performs the unary - operation. Read more
Source§

impl<T> PartialEq for Matrix33<T>
where T: Real + PartialEq,

Source§

fn eq(&self, other: &Matrix33<T>) -> 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<T> Sub<T> for Matrix33<T>
where T: Real,

Source§

type Output = Matrix33<T>

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<T> Copy for Matrix33<T>
where T: Real + Copy,

Source§

impl<T> Eq for Matrix33<T>
where T: Real + Eq,

Source§

impl<T> StructuralPartialEq for Matrix33<T>
where T: Real,

Auto Trait Implementations§

§

impl<T> Freeze for Matrix33<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Matrix33<T>
where T: RefUnwindSafe,

§

impl<T> Send for Matrix33<T>
where T: Send,

§

impl<T> Sync for Matrix33<T>
where T: Sync,

§

impl<T> Unpin for Matrix33<T>
where T: Unpin,

§

impl<T> UnwindSafe for Matrix33<T>
where T: UnwindSafe,

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 = 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.