Skip to main content

Matrix3

Struct Matrix3 

Source
pub struct Matrix3<T: CoordType> {
    pub m11: T,
    pub m12: T,
    pub m13: T,
    pub m21: T,
    pub m22: T,
    pub m23: T,
    pub m31: T,
    pub m32: T,
    pub m33: T,
}
Expand description

3x3 matrix of the form. [[ m11, m12, m13 ], [ m21, m22, m23 ], [ m31, m32, m33 ]]

Fields§

§m11: T§m12: T§m13: T§m21: T§m22: T§m23: T§m31: T§m32: T§m33: T

Implementations§

Source§

impl<T> Matrix3<T>
where T: CoordType,

Source

pub fn new( [[m11, m12, m13], [m21, m22, m23], [m31, m32, m33]]: [[T; 3]; 3], ) -> Self

Create a new 3x3 matrix with entries of the form: [[ m11, m12, m13 ], [ m21, m22, m23 ], [ m31, m32, m33 ]]

Source

pub fn identity() -> Self

Source

pub fn scalar_mul(&self, rhs: T) -> Self

Source

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

Source

pub fn mul_vec(&self, rhs: &(T, T, T)) -> (T, T, T)

Source

pub fn mat_mul(&self, rhs: &Self) -> Self

Source

pub fn transpose(&self) -> Self

Source

pub fn is_identity(&self) -> bool

Source

pub fn is_unitary(&self) -> bool

Source

pub fn determinant(&self) -> T

Source

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

Trait Implementations§

Source§

impl<T: Clone + CoordType> Clone for Matrix3<T>

Source§

fn clone(&self) -> Self

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<T: Debug + CoordType> Debug for Matrix3<T>

Source§

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

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

impl<T: CoordType> Default for Matrix3<T>

Source§

fn default() -> Self

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

impl<T: Eq + CoordType> Eq for Matrix3<T>

Source§

impl<T: Hash + CoordType> Hash for Matrix3<T>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T: PartialEq + CoordType> PartialEq for Matrix3<T>

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl<T: PartialEq + CoordType> StructuralPartialEq for Matrix3<T>

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<T> UnsafeUnpin for Matrix3<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for Matrix3<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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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.