Skip to main content

Matrix3

Struct Matrix3 

Source
pub struct Matrix3<T> {
    pub data: [[T; 3]; 3],
}
Expand description

A 3x3 matrix stored in row-major order.

Fields§

§data: [[T; 3]; 3]

data[row][col]

Implementations§

Source§

impl<T: Default + Copy> Matrix3<T>

Source

pub fn zeros() -> Self

All-zero matrix.

Source§

impl Matrix3<f64>

Source

pub fn identity() -> Self

Identity.

Source

pub fn from_columns( c0: &Vector3<f64>, c1: &Vector3<f64>, c2: &Vector3<f64>, ) -> Self

Build from three column vectors (nalgebra compat).

Source

pub fn from_iterator<I: IntoIterator<Item = f64>>(iter: I) -> Self

Build from a column-major iterator (nalgebra compat: column-major flat).

Source

pub fn transpose(&self) -> Self

Transpose.

Source

pub fn determinant(&self) -> f64

Determinant.

Source

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

Try to invert.

Source

pub fn svd(&self, compute_u: bool, compute_v: bool) -> Svd3

SVD decomposition. Returns (u, sigma, v_t) where each is Option<Matrix3> for compatibility with nalgebra’s SVD API. Uses Jacobi one-sided SVD.

Source

pub fn column(&self, c: usize) -> Vector3<f64>

Column as Vector3.

Source

pub fn mul_vec(&self, v: &Vector3<f64>) -> Vector3<f64>

Multiply by Vector3.

Trait Implementations§

Source§

impl Add for Matrix3<f64>

Source§

type Output = Matrix3<f64>

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl AddAssign for Matrix3<f64>

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

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

Source§

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

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: Copy> Copy for Matrix3<T>

Source§

impl<T: Debug> Debug for Matrix3<T>

Source§

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

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

impl<'de, T> Deserialize<'de> for Matrix3<T>
where T: Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Index<(usize, usize)> for Matrix3<f64>

Source§

type Output = f64

The returned type after indexing.
Source§

fn index(&self, (r, c): (usize, usize)) -> &f64

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

impl IndexMut<(usize, usize)> for Matrix3<f64>

Source§

fn index_mut(&mut self, (r, c): (usize, usize)) -> &mut f64

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

impl Mul for Matrix3<f64>

Source§

type Output = Matrix3<f64>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl Mul<Matrix3<f64>> for Matrix6x3

Matrix6x3 * Matrix3 → Matrix6x3 (P * H^T * S^{-1})

Source§

type Output = Matrix6x3

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl Mul<Matrix3<f64>> for f64

Source§

type Output = Matrix3<f64>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Matrix3<f64>) -> Matrix3<f64>

Performs the * operation. Read more
Source§

impl Mul<Point3<f64>> for Matrix3<f64>

Matrix3 * Point3 → Point3 (transform point).

Source§

type Output = Point3<f64>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Point3<f64>) -> Point3<f64>

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for Matrix3<f64>

Matrix3 * Vector3 → Vector3

Source§

type Output = Vector3<f64>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Vector3<f64>

Performs the * operation. Read more
Source§

impl Mul<f64> for Matrix3<f64>

Source§

type Output = Matrix3<f64>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

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

Source§

fn eq(&self, other: &Matrix3<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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> Serialize for Matrix3<T>
where T: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<T> 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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 = 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.