[][src]Struct nannou::math::Matrix2

#[repr(C)]
pub struct Matrix2<S> { pub x: Vector2<S>, pub y: Vector2<S>, }

A 2 x 2, column major matrix

This type is marked as #[repr(C)].

Fields

x: Vector2<S>

The first column of the matrix.

y: Vector2<S>

The second column of the matrix.

Methods

impl<S> Matrix2<S> where
    S: BaseFloat
[src]

pub fn new(c0r0: S, c0r1: S, c1r0: S, c1r1: S) -> Matrix2<S>[src]

Create a new matrix, providing values for each index.

pub fn from_cols(c0: Vector2<S>, c1: Vector2<S>) -> Matrix2<S>[src]

Create a new matrix, providing columns.

pub fn look_at(dir: Vector2<S>, up: Vector2<S>) -> Matrix2<S>[src]

Create a transformation matrix that will cause a vector to point at dir, using up for orientation.

pub fn from_angle<A>(theta: A) -> Matrix2<S> where
    A: Into<Rad<S>>, 
[src]

impl<S> Matrix2<S> where
    S: Copy + NumCast
[src]

pub fn cast<T>(&self) -> Option<Matrix2<T>> where
    T: NumCast
[src]

Component-wise casting to another type

Trait Implementations

impl<S> Clone for Matrix2<S> where
    S: Clone
[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<S> Zero for Matrix2<S> where
    S: BaseFloat
[src]

fn set_zero(&mut self)[src]

Sets self to the additive identity element of Self, 0.

impl<S> Serialize for Matrix2<S> where
    S: Serialize
[src]

impl<S> ApproxEq for Matrix2<S> where
    S: BaseFloat
[src]

type Epsilon = <S as ApproxEq>::Epsilon

Used for specifying relative comparisons.

fn relative_ne(
    &self,
    other: &Self,
    epsilon: Self::Epsilon,
    max_relative: Self::Epsilon
) -> bool
[src]

The inverse of ApproxEq::relative_eq.

fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool[src]

The inverse of ApproxEq::ulps_eq.

impl<S> From<Matrix2<S>> for Matrix3<S> where
    S: BaseFloat
[src]

fn from(m: Matrix2<S>) -> Matrix3<S>[src]

Clone the elements of a 2-dimensional matrix into the top-left corner of a 3-dimensional identity matrix.

impl<S> From<Matrix2<S>> for Matrix4<S> where
    S: BaseFloat
[src]

fn from(m: Matrix2<S>) -> Matrix4<S>[src]

Clone the elements of a 2-dimensional matrix into the top-left corner of a 4-dimensional identity matrix.

impl<'a, S> From<&'a [S; 4]> for &'a Matrix2<S>[src]

impl<'a, S> From<&'a mut [[S; 2]; 2]> for &'a mut Matrix2<S>[src]

impl<'a, S> From<&'a [[S; 2]; 2]> for &'a Matrix2<S>[src]

impl<'a, S> From<&'a mut [S; 4]> for &'a mut Matrix2<S>[src]

impl<S> From<Basis2<S>> for Matrix2<S> where
    S: BaseFloat
[src]

impl<S> From<[[S; 2]; 2]> for Matrix2<S> where
    S: Copy
[src]

impl<S> AsRef<[S; 4]> for Matrix2<S>[src]

impl<S> AsRef<Matrix2<S>> for Basis2<S> where
    S: BaseFloat
[src]

impl<S> AsRef<[[S; 2]; 2]> for Matrix2<S>[src]

impl<S> Div<S> for Matrix2<S> where
    S: BaseFloat
[src]

type Output = Matrix2<S>

The resulting type after applying the / operator.

impl<'a, S> Div<S> for &'a Matrix2<S> where
    S: BaseFloat
[src]

type Output = Matrix2<S>

The resulting type after applying the / operator.

impl<S> MulAssign<S> for Matrix2<S> where
    S: BaseFloat + MulAssign<S>, 
[src]

impl<S> SubAssign<Matrix2<S>> for Matrix2<S> where
    S: BaseFloat + SubAssign<S>, 
[src]

impl<S> IndexMut<usize> for Matrix2<S>[src]

impl<S> RemAssign<S> for Matrix2<S> where
    S: BaseFloat + RemAssign<S>, 
[src]

impl<'a, S> Mul<S> for &'a Matrix2<S> where
    S: BaseFloat
[src]

type Output = Matrix2<S>

The resulting type after applying the * operator.

impl<'a, S> Mul<Matrix2<S>> for &'a Matrix2<S> where
    S: BaseFloat
[src]

type Output = Matrix2<S>

The resulting type after applying the * operator.

impl<S> Mul<S> for Matrix2<S> where
    S: BaseFloat
[src]

type Output = Matrix2<S>

The resulting type after applying the * operator.

impl<'a, S> Mul<&'a Matrix2<S>> for Matrix2<S> where
    S: BaseFloat
[src]

type Output = Matrix2<S>

The resulting type after applying the * operator.

impl<'a, 'b, S> Mul<&'a Matrix2<S>> for &'b Matrix2<S> where
    S: BaseFloat
[src]

type Output = Matrix2<S>

The resulting type after applying the * operator.

impl<'a, S> Mul<Vector2<S>> for &'a Matrix2<S> where
    S: BaseFloat
[src]

type Output = Vector2<S>

The resulting type after applying the * operator.

impl<S> Mul<Vector2<S>> for Matrix2<S> where
    S: BaseFloat
[src]

type Output = Vector2<S>

The resulting type after applying the * operator.

impl<'a, 'b, S> Mul<&'a Vector2<S>> for &'b Matrix2<S> where
    S: BaseFloat
[src]

type Output = Vector2<S>

The resulting type after applying the * operator.

impl<S> Mul<Matrix2<S>> for Matrix2<S> where
    S: BaseFloat
[src]

type Output = Matrix2<S>

The resulting type after applying the * operator.

impl<'a, S> Mul<&'a Vector2<S>> for Matrix2<S> where
    S: BaseFloat
[src]

type Output = Vector2<S>

The resulting type after applying the * operator.

impl<S> Matrix for Matrix2<S> where
    S: BaseFloat
[src]

type Column = Vector2<S>

The column vector of the matrix.

type Row = Vector2<S>

The row vector of the matrix.

type Transpose = Matrix2<S>

The result of transposing the matrix

fn as_ptr(&self) -> *const Self::Scalar[src]

Get the pointer to the first element of the array.

fn as_mut_ptr(&mut self) -> *mut Self::Scalar[src]

Get a mutable pointer to the first element of the array.

fn replace_col(&mut self, c: usize, src: Self::Column) -> Self::Column[src]

Replace a column in the array.

impl<S> Neg for Matrix2<S> where
    S: BaseFloat
[src]

type Output = Matrix2<S>

The resulting type after applying the - operator.

impl<'a, S> Neg for &'a Matrix2<S> where
    S: BaseFloat
[src]

type Output = Matrix2<S>

The resulting type after applying the - operator.

impl<S> Rem<S> for Matrix2<S> where
    S: BaseFloat
[src]

type Output = Matrix2<S>

The resulting type after applying the % operator.

impl<'a, S> Rem<S> for &'a Matrix2<S> where
    S: BaseFloat
[src]

type Output = Matrix2<S>

The resulting type after applying the % operator.

impl<S> AsMut<[S; 4]> for Matrix2<S>[src]

impl<S> AsMut<[[S; 2]; 2]> for Matrix2<S>[src]

impl<S> Debug for Matrix2<S> where
    S: Debug
[src]

impl<S> Into<[[S; 2]; 2]> for Matrix2<S>[src]

impl<S> Copy for Matrix2<S> where
    S: Copy
[src]

impl<S> Index<usize> for Matrix2<S>[src]

type Output = Vector2<S>

The returned type after indexing.

impl<S> PartialEq<Matrix2<S>> for Matrix2<S> where
    S: PartialEq<S>, 
[src]

impl<'a, S> Product<&'a Matrix2<S>> for Matrix2<S> where
    S: 'a + BaseFloat
[src]

impl<S> Product<Matrix2<S>> for Matrix2<S> where
    S: BaseFloat
[src]

impl<S> AddAssign<Matrix2<S>> for Matrix2<S> where
    S: BaseFloat + AddAssign<S>, 
[src]

impl<S> SquareMatrix for Matrix2<S> where
    S: BaseFloat
[src]

type ColumnRow = Vector2<S>

The row/column vector of the matrix. Read more

fn identity() -> Self[src]

The [identity matrix]. Multiplying this matrix with another should have no effect. Read more

fn trace(&self) -> Self::Scalar[src]

Return the trace of this matrix. That is, the sum of the diagonal.

fn is_invertible(&self) -> bool[src]

Test if this matrix is invertible.

fn is_identity(&self) -> bool[src]

Test if this matrix is the identity matrix. That is, it is diagonal and every element in the diagonal is one. Read more

impl<S> Add<Matrix2<S>> for Matrix2<S> where
    S: BaseFloat
[src]

type Output = Matrix2<S>

The resulting type after applying the + operator.

impl<'a, S> Add<Matrix2<S>> for &'a Matrix2<S> where
    S: BaseFloat
[src]

type Output = Matrix2<S>

The resulting type after applying the + operator.

impl<'a, S> Add<&'a Matrix2<S>> for Matrix2<S> where
    S: BaseFloat
[src]

type Output = Matrix2<S>

The resulting type after applying the + operator.

impl<'a, 'b, S> Add<&'a Matrix2<S>> for &'b Matrix2<S> where
    S: BaseFloat
[src]

type Output = Matrix2<S>

The resulting type after applying the + operator.

impl<'a, S> Sub<&'a Matrix2<S>> for Matrix2<S> where
    S: BaseFloat
[src]

type Output = Matrix2<S>

The resulting type after applying the - operator.

impl<'a, S> Sub<Matrix2<S>> for &'a Matrix2<S> where
    S: BaseFloat
[src]

type Output = Matrix2<S>

The resulting type after applying the - operator.

impl<'a, 'b, S> Sub<&'a Matrix2<S>> for &'b Matrix2<S> where
    S: BaseFloat
[src]

type Output = Matrix2<S>

The resulting type after applying the - operator.

impl<S> Sub<Matrix2<S>> for Matrix2<S> where
    S: BaseFloat
[src]

type Output = Matrix2<S>

The resulting type after applying the - operator.

impl<S> DivAssign<S> for Matrix2<S> where
    S: BaseFloat + DivAssign<S>, 
[src]

impl<S> One for Matrix2<S> where
    S: BaseFloat
[src]

fn set_one(&mut self)[src]

Sets self to the multiplicative identity element of Self, 1.

fn is_one(&self) -> bool where
    Self: PartialEq<Self>, 
[src]

Returns true if self is equal to the multiplicative identity. Read more

impl<S> VectorSpace for Matrix2<S> where
    S: BaseFloat
[src]

type Scalar = S

The associated scalar.

impl<S> Sum<Matrix2<S>> for Matrix2<S> where
    S: BaseFloat
[src]

impl<'a, S> Sum<&'a Matrix2<S>> for Matrix2<S> where
    S: 'a + BaseFloat
[src]

impl<S> Rand for Matrix2<S> where
    S: BaseFloat + Rand
[src]

impl<'de, S> Deserialize<'de> for Matrix2<S> where
    S: Deserialize<'de>, 
[src]

Auto Trait Implementations

impl<S> Send for Matrix2<S> where
    S: Send

impl<S> Sync for Matrix2<S> where
    S: Sync

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, Rhs> NumAssignOps<Rhs> for T where
    T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>, 
[src]

impl<T, Rhs, Output> NumOps<Rhs, Output> for T where
    T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>, 
[src]

impl<T> Style for T where
    T: Any + Debug + PartialEq<T>, 
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Content for T[src]

impl<T> SafeBorrow<T> for T[src]

impl<T> Erased for T

impl<S> FromSample<S> for S[src]

impl<T, U> ToSample<U> for T where
    U: FromSample<T>, 
[src]

impl<S, T> Duplex<S> for T where
    T: FromSample<S> + ToSample<S>, 
[src]

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.