Skip to main content

Mat

Struct Mat 

Source
#[repr(transparent)]
pub struct Mat<const N: usize, const M: usize, S: Field>(pub [[S; M]; N]);

Tuple Fields§

§0: [[S; M]; N]

Implementations§

Source§

impl<S: Field> Mat<4, 4, S>

Source

pub fn affine(linear: Mat<3, 3, S>, translation: Vect<3, S>) -> Self

Source

pub fn linear(linear: Mat<3, 3, S>) -> Self

Source

pub fn translation(translation: Vect<3, S>) -> Self

Source

pub fn perspective_projection(aspect: S, fov: S, n: S, f: S) -> Self

Source

pub fn uniform_scale(scale: S) -> Self

Source§

impl<S: Field, const N: usize, const M: usize> Mat<N, M, S>

Source

pub fn from_scs(array: [[Sc<S>; M]; N]) -> Self

Source

pub fn map<T: Field>(self, f: impl Fn(S) -> T) -> Mat<N, M, T>

Source§

impl<const N: usize, const M: usize> Mat<N, M, f32>

Source

pub fn to_f64(self) -> Mat<N, M, f64>

Source§

impl<const N: usize, const M: usize> Mat<N, M, f64>

Source

pub fn to_f32(self) -> Mat<N, M, f32>

Source§

impl<S: Field, const N: usize, const M: usize> Mat<N, M, S>

Source

pub fn try_index(&self, i: usize, j: usize) -> Option<S>

Source§

impl<S: Field, const N: usize> Mat<N, N, S>

Source

pub fn inverse(&self) -> Self

Source§

impl<S: Field, const N: usize, const M: usize> Mat<N, M, S>

Source

pub const ZERO: Self

Source

pub fn from_fn<F: Fn(usize, usize) -> S>(f: F) -> Self

Source§

impl<S: Field, const N: usize> Mat<N, N, S>

Source

pub const IDENT: Self

Source§

impl<S: Field, const N: usize, const M: usize> Mat<N, M, S>

Source

pub fn row(&self, i: usize) -> Vect<M, S>

Source

pub fn col(&self, j: usize) -> Vect<N, S>

Source§

impl<S: Field> Mat<4, 4, S>

Source

pub fn flatten(self) -> [S; 16]

Trait Implementations§

Source§

impl<S: Field, const N: usize, const M: usize> Add for Mat<N, M, S>

Source§

type Output = Mat<N, M, S>

The resulting type after applying the + operator.
Source§

fn add(self, other: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize, const M: usize, S: Clone + Field> Clone for Mat<N, M, S>

Source§

fn clone(&self) -> Mat<N, M, S>

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<const N: usize, const M: usize, S: Copy + Field> Copy for Mat<N, M, S>

Source§

impl<const N: usize, const M: usize, S: Debug + Field> Debug for Mat<N, M, S>

Source§

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

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

impl<S: Field, const N: usize, const M: usize> Default for Mat<N, M, S>

Source§

fn default() -> Self

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

impl<S: Field> Det for Mat<1, 1, S>

Source§

type Output = S

Source§

fn det(self) -> S

Source§

impl<S: Field> Det for Mat<2, 2, S>

Source§

type Output = S

Source§

fn det(self) -> S

Source§

impl<S: Field> Det for Mat<3, 3, S>

Source§

type Output = S

Source§

fn det(self) -> S

Source§

impl<S: Field + Display, const N: usize, const M: usize> Display for Mat<N, M, S>

Source§

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

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

impl<const N: usize, const M: usize, S: Eq + Field> Eq for Mat<N, M, S>

Source§

impl<const N: usize, const M: usize, S: Hash + Field> Hash for Mat<N, M, S>

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<S: Field, const N: usize, const M: usize> Index<usize> for Mat<N, M, S>

Source§

type Output = [S; M]

The returned type after indexing.
Source§

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

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

impl<S: Field, const N: usize, const M: usize, const P: usize> Mul<Mat<M, P, S>> for Mat<N, M, S>

Source§

type Output = Mat<N, P, S>

The resulting type after applying the * operator.
Source§

fn mul(self, other: Mat<M, P, S>) -> Self::Output

Performs the * operation. Read more
Source§

impl<S: Field, const N: usize, const M: usize> Mul<Mat<N, M, S>> for Vect<N, S>

Source§

type Output = Vect<N, S>

The resulting type after applying the * operator.
Source§

fn mul(self, matrix: Mat<N, M, S>) -> Self::Output

Performs the * operation. Read more
Source§

impl<S: Field, const N: usize, const M: usize> Mul<S> for Mat<N, M, S>

Source§

type Output = Mat<N, M, S>

The resulting type after applying the * operator.
Source§

fn mul(self, scalar: S) -> Self::Output

Performs the * operation. Read more
Source§

impl<S: Field, const N: usize, const M: usize> Mul<Vect<M, S>> for Mat<N, M, S>

Source§

type Output = Vect<N, S>

The resulting type after applying the * operator.
Source§

fn mul(self, vector: Vect<M, S>) -> Self::Output

Performs the * operation. Read more
Source§

impl<S: Field, const N: usize, const M: usize> Neg for Mat<N, M, S>

Source§

type Output = Mat<N, M, S>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<const N: usize, const M: usize, S: PartialEq + Field> PartialEq for Mat<N, M, S>

Source§

fn eq(&self, other: &Mat<N, M, S>) -> bool

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

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

Inequality operator !=. Read more
Source§

impl<const N: usize, const M: usize, S: PartialEq + Field> StructuralPartialEq for Mat<N, M, S>

Source§

impl<S: Field, const N: usize, const M: usize> Sub for Mat<N, M, S>

Source§

type Output = Mat<N, M, S>

The resulting type after applying the - operator.
Source§

fn sub(self, other: Self) -> Self::Output

Performs the - operation. Read more

Auto Trait Implementations§

§

impl<const N: usize, const M: usize, S> Freeze for Mat<N, M, S>
where [[S; M]; N]: Freeze,

§

impl<const N: usize, const M: usize, S> RefUnwindSafe for Mat<N, M, S>

§

impl<const N: usize, const M: usize, S> Send for Mat<N, M, S>
where [[S; M]; N]: Send,

§

impl<const N: usize, const M: usize, S> Sync for Mat<N, M, S>
where [[S; M]; N]: Sync,

§

impl<const N: usize, const M: usize, S> Unpin for Mat<N, M, S>
where [[S; M]; N]: Unpin,

§

impl<const N: usize, const M: usize, S> UnsafeUnpin for Mat<N, M, S>
where [[S; M]; N]: UnsafeUnpin,

§

impl<const N: usize, const M: usize, S> UnwindSafe for Mat<N, M, S>
where [[S; M]; N]: 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<A, T> Apl<T> for A
where T: Aplable<A>,

Source§

type Output = <T as Aplable<A>>::Output

Source§

fn apl(self, other: T) -> <A as Apl<T>>::Output

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> Maybe<T> for T

Source§

fn maybe(self) -> Option<T>

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

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.