[][src]Struct cgmath::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>[src]

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

Create a new matrix, providing values for each index.

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

Create a new matrix, providing columns.

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

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: Into<Rad<S>>>(theta: A) -> Matrix2<S>[src]

pub fn is_finite(&self) -> bool[src]

Are all entries in the matrix finite.

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

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

Component-wise casting to another type

Trait Implementations

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

type Scalar = S

The associated scalar.

impl<S: BaseFloat> Matrix for Matrix2<S>[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

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

type ColumnRow = Vector2<S>

The row/column vector of the matrix. Read more

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

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

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

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

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

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

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

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

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

impl<'a, S> From<&'a [[S; 2]; 2]> 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; 4]> for &'a Matrix2<S>[src]

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

impl<S: BaseFloat> From<Matrix2<S>> for Matrix3<S>[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: BaseFloat> From<Matrix2<S>> for Matrix4<S>[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<S: BaseFloat> From<Basis2<S>> for Matrix2<S>[src]

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

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

type Output = Matrix2<S>

The resulting type after applying the + operator.

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

type Output = Matrix2<S>

The resulting type after applying the + operator.

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

type Output = Matrix2<S>

The resulting type after applying the + operator.

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

type Output = Matrix2<S>

The resulting type after applying the + operator.

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

type Output = Matrix2<S>

The resulting type after applying the - operator.

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

type Output = Matrix2<S>

The resulting type after applying the - operator.

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

type Output = Matrix2<S>

The resulting type after applying the - operator.

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

type Output = Matrix2<S>

The resulting type after applying the - operator.

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

type Output = Matrix2<S>

The resulting type after applying the * operator.

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

type Output = Matrix2<S>

The resulting type after applying the * operator.

impl Mul<Matrix2<usize>> for usize[src]

type Output = Matrix2<usize>

The resulting type after applying the * operator.

impl<'a> Mul<&'a Matrix2<usize>> for usize[src]

type Output = Matrix2<usize>

The resulting type after applying the * operator.

impl Mul<Matrix2<u8>> for u8[src]

type Output = Matrix2<u8>

The resulting type after applying the * operator.

impl<'a> Mul<&'a Matrix2<u8>> for u8[src]

type Output = Matrix2<u8>

The resulting type after applying the * operator.

impl Mul<Matrix2<u16>> for u16[src]

type Output = Matrix2<u16>

The resulting type after applying the * operator.

impl<'a> Mul<&'a Matrix2<u16>> for u16[src]

type Output = Matrix2<u16>

The resulting type after applying the * operator.

impl Mul<Matrix2<u32>> for u32[src]

type Output = Matrix2<u32>

The resulting type after applying the * operator.

impl<'a> Mul<&'a Matrix2<u32>> for u32[src]

type Output = Matrix2<u32>

The resulting type after applying the * operator.

impl Mul<Matrix2<u64>> for u64[src]

type Output = Matrix2<u64>

The resulting type after applying the * operator.

impl<'a> Mul<&'a Matrix2<u64>> for u64[src]

type Output = Matrix2<u64>

The resulting type after applying the * operator.

impl Mul<Matrix2<isize>> for isize[src]

type Output = Matrix2<isize>

The resulting type after applying the * operator.

impl<'a> Mul<&'a Matrix2<isize>> for isize[src]

type Output = Matrix2<isize>

The resulting type after applying the * operator.

impl Mul<Matrix2<i8>> for i8[src]

type Output = Matrix2<i8>

The resulting type after applying the * operator.

impl<'a> Mul<&'a Matrix2<i8>> for i8[src]

type Output = Matrix2<i8>

The resulting type after applying the * operator.

impl Mul<Matrix2<i16>> for i16[src]

type Output = Matrix2<i16>

The resulting type after applying the * operator.

impl<'a> Mul<&'a Matrix2<i16>> for i16[src]

type Output = Matrix2<i16>

The resulting type after applying the * operator.

impl Mul<Matrix2<i32>> for i32[src]

type Output = Matrix2<i32>

The resulting type after applying the * operator.

impl<'a> Mul<&'a Matrix2<i32>> for i32[src]

type Output = Matrix2<i32>

The resulting type after applying the * operator.

impl Mul<Matrix2<i64>> for i64[src]

type Output = Matrix2<i64>

The resulting type after applying the * operator.

impl<'a> Mul<&'a Matrix2<i64>> for i64[src]

type Output = Matrix2<i64>

The resulting type after applying the * operator.

impl Mul<Matrix2<f32>> for f32[src]

type Output = Matrix2<f32>

The resulting type after applying the * operator.

impl<'a> Mul<&'a Matrix2<f32>> for f32[src]

type Output = Matrix2<f32>

The resulting type after applying the * operator.

impl Mul<Matrix2<f64>> for f64[src]

type Output = Matrix2<f64>

The resulting type after applying the * operator.

impl<'a> Mul<&'a Matrix2<f64>> for f64[src]

type Output = Matrix2<f64>

The resulting type after applying the * operator.

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

type Output = Vector2<S>

The resulting type after applying the * operator.

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

type Output = Vector2<S>

The resulting type after applying the * operator.

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

type Output = Vector2<S>

The resulting type after applying the * operator.

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

type Output = Vector2<S>

The resulting type after applying the * operator.

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

type Output = Matrix2<S>

The resulting type after applying the * operator.

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

type Output = Matrix2<S>

The resulting type after applying the * operator.

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

type Output = Matrix2<S>

The resulting type after applying the * operator.

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

type Output = Matrix2<S>

The resulting type after applying the * operator.

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

type Output = Matrix2<S>

The resulting type after applying the / operator.

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

type Output = Matrix2<S>

The resulting type after applying the / operator.

impl Div<Matrix2<usize>> for usize[src]

type Output = Matrix2<usize>

The resulting type after applying the / operator.

impl<'a> Div<&'a Matrix2<usize>> for usize[src]

type Output = Matrix2<usize>

The resulting type after applying the / operator.

impl Div<Matrix2<u8>> for u8[src]

type Output = Matrix2<u8>

The resulting type after applying the / operator.

impl<'a> Div<&'a Matrix2<u8>> for u8[src]

type Output = Matrix2<u8>

The resulting type after applying the / operator.

impl Div<Matrix2<u16>> for u16[src]

type Output = Matrix2<u16>

The resulting type after applying the / operator.

impl<'a> Div<&'a Matrix2<u16>> for u16[src]

type Output = Matrix2<u16>

The resulting type after applying the / operator.

impl Div<Matrix2<u32>> for u32[src]

type Output = Matrix2<u32>

The resulting type after applying the / operator.

impl<'a> Div<&'a Matrix2<u32>> for u32[src]

type Output = Matrix2<u32>

The resulting type after applying the / operator.

impl Div<Matrix2<u64>> for u64[src]

type Output = Matrix2<u64>

The resulting type after applying the / operator.

impl<'a> Div<&'a Matrix2<u64>> for u64[src]

type Output = Matrix2<u64>

The resulting type after applying the / operator.

impl Div<Matrix2<isize>> for isize[src]

type Output = Matrix2<isize>

The resulting type after applying the / operator.

impl<'a> Div<&'a Matrix2<isize>> for isize[src]

type Output = Matrix2<isize>

The resulting type after applying the / operator.

impl Div<Matrix2<i8>> for i8[src]

type Output = Matrix2<i8>

The resulting type after applying the / operator.

impl<'a> Div<&'a Matrix2<i8>> for i8[src]

type Output = Matrix2<i8>

The resulting type after applying the / operator.

impl Div<Matrix2<i16>> for i16[src]

type Output = Matrix2<i16>

The resulting type after applying the / operator.

impl<'a> Div<&'a Matrix2<i16>> for i16[src]

type Output = Matrix2<i16>

The resulting type after applying the / operator.

impl Div<Matrix2<i32>> for i32[src]

type Output = Matrix2<i32>

The resulting type after applying the / operator.

impl<'a> Div<&'a Matrix2<i32>> for i32[src]

type Output = Matrix2<i32>

The resulting type after applying the / operator.

impl Div<Matrix2<i64>> for i64[src]

type Output = Matrix2<i64>

The resulting type after applying the / operator.

impl<'a> Div<&'a Matrix2<i64>> for i64[src]

type Output = Matrix2<i64>

The resulting type after applying the / operator.

impl Div<Matrix2<f32>> for f32[src]

type Output = Matrix2<f32>

The resulting type after applying the / operator.

impl<'a> Div<&'a Matrix2<f32>> for f32[src]

type Output = Matrix2<f32>

The resulting type after applying the / operator.

impl Div<Matrix2<f64>> for f64[src]

type Output = Matrix2<f64>

The resulting type after applying the / operator.

impl<'a> Div<&'a Matrix2<f64>> for f64[src]

type Output = Matrix2<f64>

The resulting type after applying the / operator.

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

type Output = Matrix2<S>

The resulting type after applying the % operator.

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

type Output = Matrix2<S>

The resulting type after applying the % operator.

impl Rem<Matrix2<usize>> for usize[src]

type Output = Matrix2<usize>

The resulting type after applying the % operator.

impl<'a> Rem<&'a Matrix2<usize>> for usize[src]

type Output = Matrix2<usize>

The resulting type after applying the % operator.

impl Rem<Matrix2<u8>> for u8[src]

type Output = Matrix2<u8>

The resulting type after applying the % operator.

impl<'a> Rem<&'a Matrix2<u8>> for u8[src]

type Output = Matrix2<u8>

The resulting type after applying the % operator.

impl Rem<Matrix2<u16>> for u16[src]

type Output = Matrix2<u16>

The resulting type after applying the % operator.

impl<'a> Rem<&'a Matrix2<u16>> for u16[src]

type Output = Matrix2<u16>

The resulting type after applying the % operator.

impl Rem<Matrix2<u32>> for u32[src]

type Output = Matrix2<u32>

The resulting type after applying the % operator.

impl<'a> Rem<&'a Matrix2<u32>> for u32[src]

type Output = Matrix2<u32>

The resulting type after applying the % operator.

impl Rem<Matrix2<u64>> for u64[src]

type Output = Matrix2<u64>

The resulting type after applying the % operator.

impl<'a> Rem<&'a Matrix2<u64>> for u64[src]

type Output = Matrix2<u64>

The resulting type after applying the % operator.

impl Rem<Matrix2<isize>> for isize[src]

type Output = Matrix2<isize>

The resulting type after applying the % operator.

impl<'a> Rem<&'a Matrix2<isize>> for isize[src]

type Output = Matrix2<isize>

The resulting type after applying the % operator.

impl Rem<Matrix2<i8>> for i8[src]

type Output = Matrix2<i8>

The resulting type after applying the % operator.

impl<'a> Rem<&'a Matrix2<i8>> for i8[src]

type Output = Matrix2<i8>

The resulting type after applying the % operator.

impl Rem<Matrix2<i16>> for i16[src]

type Output = Matrix2<i16>

The resulting type after applying the % operator.

impl<'a> Rem<&'a Matrix2<i16>> for i16[src]

type Output = Matrix2<i16>

The resulting type after applying the % operator.

impl Rem<Matrix2<i32>> for i32[src]

type Output = Matrix2<i32>

The resulting type after applying the % operator.

impl<'a> Rem<&'a Matrix2<i32>> for i32[src]

type Output = Matrix2<i32>

The resulting type after applying the % operator.

impl Rem<Matrix2<i64>> for i64[src]

type Output = Matrix2<i64>

The resulting type after applying the % operator.

impl<'a> Rem<&'a Matrix2<i64>> for i64[src]

type Output = Matrix2<i64>

The resulting type after applying the % operator.

impl Rem<Matrix2<f32>> for f32[src]

type Output = Matrix2<f32>

The resulting type after applying the % operator.

impl<'a> Rem<&'a Matrix2<f32>> for f32[src]

type Output = Matrix2<f32>

The resulting type after applying the % operator.

impl Rem<Matrix2<f64>> for f64[src]

type Output = Matrix2<f64>

The resulting type after applying the % operator.

impl<'a> Rem<&'a Matrix2<f64>> for f64[src]

type Output = Matrix2<f64>

The resulting type after applying the % operator.

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

type Output = Matrix2<S>

The resulting type after applying the - operator.

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

type Output = Matrix2<S>

The resulting type after applying the - operator.

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

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

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

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

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

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

type Output = Vector2<S>

The returned type after indexing.

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

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

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

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

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

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

impl<S: BaseFloat> AbsDiffEq<Matrix2<S>> for Matrix2<S>[src]

type Epsilon = S::Epsilon

Used for specifying relative comparisons.

impl<S: BaseFloat> RelativeEq<Matrix2<S>> for Matrix2<S>[src]

impl<S: BaseFloat> UlpsEq<Matrix2<S>> for Matrix2<S>[src]

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

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

impl<S> Distribution<Matrix2<S>> for Standard where
    Standard: Distribution<Vector2<S>>,
    S: BaseFloat
[src]

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

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> From<T> for 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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[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, Rhs> NumAssignOps<Rhs> for T where
    T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>, 
[src]