Struct cgmath::Matrix2

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

A 2 x 2, column major matrix

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

Fields§

§x: Vector2<S>

The first column of the matrix.

§y: Vector2<S>

The second column of the matrix.

Implementations§

source§

impl<S: BaseFloat> Matrix2<S>

source

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

Create a new matrix, providing values for each index.

source

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

Create a new matrix, providing columns.

source

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

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

source

pub fn from_angle<A: Into<Rad<S>>>(theta: A) -> Matrix2<S>

Trait Implementations§

source§

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

§

type Output = Matrix2<S>

The resulting type after applying the + operator.
source§

fn add(self, other: &'a Matrix2<S>) -> Matrix2<S>

Performs the + operation. Read more
source§

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

§

type Output = Matrix2<S>

The resulting type after applying the + operator.
source§

fn add(self, other: &'a Matrix2<S>) -> Matrix2<S>

Performs the + operation. Read more
source§

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

§

type Output = Matrix2<S>

The resulting type after applying the + operator.
source§

fn add(self, other: Matrix2<S>) -> Matrix2<S>

Performs the + operation. Read more
source§

impl<S: BaseFloat> Add<Matrix2<S>> for Matrix2<S>

§

type Output = Matrix2<S>

The resulting type after applying the + operator.
source§

fn add(self, other: Matrix2<S>) -> Matrix2<S>

Performs the + operation. Read more
source§

impl<S: BaseFloat + AddAssign<S>> AddAssign<Matrix2<S>> for Matrix2<S>

source§

fn add_assign(&mut self, other: Matrix2<S>)

Performs the += operation. Read more
source§

impl<S: BaseFloat> ApproxEq for Matrix2<S>

§

type Epsilon = S

source§

fn approx_eq_eps(&self, other: &Matrix2<S>, epsilon: &S) -> bool

source§

fn approx_epsilon() -> Self::Epsilon

source§

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

source§

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

source§

fn as_mut(&mut self) -> &mut [[S; 2]; 2]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

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

source§

fn as_mut(&mut self) -> &mut [S; 4]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

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

source§

fn as_ref(&self) -> &[[S; 2]; 2]

Converts this type into a shared reference of the (usually inferred) input type.
source§

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

source§

fn as_ref(&self) -> &[S; 4]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<S: BaseFloat> AsRef<Matrix2<S>> for Basis2<S>

source§

fn as_ref(&self) -> &Matrix2<S>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<S: Clone + Copy> Clone for Matrix2<S>

source§

fn clone(&self) -> Matrix2<S>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<S: Debug> Debug for Matrix2<S>

source§

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

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

impl<S: Decodable + Copy> Decodable for Matrix2<S>

source§

fn decode<__D: Decoder>(d: &mut __D) -> Result<Matrix2<S>, __D::Error>

Deserialize a value using a Decoder.
source§

impl<'a> Div<&'a Matrix2<f32>> for f32

§

type Output = Matrix2<f32>

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Matrix2<f32>) -> Matrix2<f32>

Performs the / operation. Read more
source§

impl<'a> Div<&'a Matrix2<f64>> for f64

§

type Output = Matrix2<f64>

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Matrix2<f64>) -> Matrix2<f64>

Performs the / operation. Read more
source§

impl<'a> Div<&'a Matrix2<i16>> for i16

§

type Output = Matrix2<i16>

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Matrix2<i16>) -> Matrix2<i16>

Performs the / operation. Read more
source§

impl<'a> Div<&'a Matrix2<i32>> for i32

§

type Output = Matrix2<i32>

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Matrix2<i32>) -> Matrix2<i32>

Performs the / operation. Read more
source§

impl<'a> Div<&'a Matrix2<i64>> for i64

§

type Output = Matrix2<i64>

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Matrix2<i64>) -> Matrix2<i64>

Performs the / operation. Read more
source§

impl<'a> Div<&'a Matrix2<i8>> for i8

§

type Output = Matrix2<i8>

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Matrix2<i8>) -> Matrix2<i8>

Performs the / operation. Read more
source§

impl<'a> Div<&'a Matrix2<isize>> for isize

§

type Output = Matrix2<isize>

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Matrix2<isize>) -> Matrix2<isize>

Performs the / operation. Read more
source§

impl<'a> Div<&'a Matrix2<u16>> for u16

§

type Output = Matrix2<u16>

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Matrix2<u16>) -> Matrix2<u16>

Performs the / operation. Read more
source§

impl<'a> Div<&'a Matrix2<u32>> for u32

§

type Output = Matrix2<u32>

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Matrix2<u32>) -> Matrix2<u32>

Performs the / operation. Read more
source§

impl<'a> Div<&'a Matrix2<u64>> for u64

§

type Output = Matrix2<u64>

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Matrix2<u64>) -> Matrix2<u64>

Performs the / operation. Read more
source§

impl<'a> Div<&'a Matrix2<u8>> for u8

§

type Output = Matrix2<u8>

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Matrix2<u8>) -> Matrix2<u8>

Performs the / operation. Read more
source§

impl<'a> Div<&'a Matrix2<usize>> for usize

§

type Output = Matrix2<usize>

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Matrix2<usize>) -> Matrix2<usize>

Performs the / operation. Read more
source§

impl Div<Matrix2<f32>> for f32

§

type Output = Matrix2<f32>

The resulting type after applying the / operator.
source§

fn div(self, other: Matrix2<f32>) -> Matrix2<f32>

Performs the / operation. Read more
source§

impl Div<Matrix2<f64>> for f64

§

type Output = Matrix2<f64>

The resulting type after applying the / operator.
source§

fn div(self, other: Matrix2<f64>) -> Matrix2<f64>

Performs the / operation. Read more
source§

impl Div<Matrix2<i16>> for i16

§

type Output = Matrix2<i16>

The resulting type after applying the / operator.
source§

fn div(self, other: Matrix2<i16>) -> Matrix2<i16>

Performs the / operation. Read more
source§

impl Div<Matrix2<i32>> for i32

§

type Output = Matrix2<i32>

The resulting type after applying the / operator.
source§

fn div(self, other: Matrix2<i32>) -> Matrix2<i32>

Performs the / operation. Read more
source§

impl Div<Matrix2<i64>> for i64

§

type Output = Matrix2<i64>

The resulting type after applying the / operator.
source§

fn div(self, other: Matrix2<i64>) -> Matrix2<i64>

Performs the / operation. Read more
source§

impl Div<Matrix2<i8>> for i8

§

type Output = Matrix2<i8>

The resulting type after applying the / operator.
source§

fn div(self, other: Matrix2<i8>) -> Matrix2<i8>

Performs the / operation. Read more
source§

impl Div<Matrix2<isize>> for isize

§

type Output = Matrix2<isize>

The resulting type after applying the / operator.
source§

fn div(self, other: Matrix2<isize>) -> Matrix2<isize>

Performs the / operation. Read more
source§

impl Div<Matrix2<u16>> for u16

§

type Output = Matrix2<u16>

The resulting type after applying the / operator.
source§

fn div(self, other: Matrix2<u16>) -> Matrix2<u16>

Performs the / operation. Read more
source§

impl Div<Matrix2<u32>> for u32

§

type Output = Matrix2<u32>

The resulting type after applying the / operator.
source§

fn div(self, other: Matrix2<u32>) -> Matrix2<u32>

Performs the / operation. Read more
source§

impl Div<Matrix2<u64>> for u64

§

type Output = Matrix2<u64>

The resulting type after applying the / operator.
source§

fn div(self, other: Matrix2<u64>) -> Matrix2<u64>

Performs the / operation. Read more
source§

impl Div<Matrix2<u8>> for u8

§

type Output = Matrix2<u8>

The resulting type after applying the / operator.
source§

fn div(self, other: Matrix2<u8>) -> Matrix2<u8>

Performs the / operation. Read more
source§

impl Div<Matrix2<usize>> for usize

§

type Output = Matrix2<usize>

The resulting type after applying the / operator.
source§

fn div(self, other: Matrix2<usize>) -> Matrix2<usize>

Performs the / operation. Read more
source§

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

§

type Output = Matrix2<S>

The resulting type after applying the / operator.
source§

fn div(self, other: S) -> Matrix2<S>

Performs the / operation. Read more
source§

impl<S: BaseFloat> Div<S> for Matrix2<S>

§

type Output = Matrix2<S>

The resulting type after applying the / operator.
source§

fn div(self, other: S) -> Matrix2<S>

Performs the / operation. Read more
source§

impl<S: BaseFloat + DivAssign<S>> DivAssign<S> for Matrix2<S>

source§

fn div_assign(&mut self, scalar: S)

Performs the /= operation. Read more
source§

impl<S: Encodable + Copy> Encodable for Matrix2<S>

source§

fn encode<__S: Encoder>(&self, s: &mut __S) -> Result<(), __S::Error>

Serialize a value using an Encoder.
source§

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

source§

fn from(m: &'a [[S; 2]; 2]) -> &'a Matrix2<S>

Converts to this type from the input type.
source§

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

source§

fn from(m: &'a [S; 4]) -> &'a Matrix2<S>

Converts to this type from the input type.
source§

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

source§

fn from(m: &'a mut [[S; 2]; 2]) -> &'a mut Matrix2<S>

Converts to this type from the input type.
source§

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

source§

fn from(m: &'a mut [S; 4]) -> &'a mut Matrix2<S>

Converts to this type from the input type.
source§

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

source§

fn from(m: [[S; 2]; 2]) -> Matrix2<S>

Converts to this type from the input type.
source§

impl<S: BaseFloat> From<Basis2<S>> for Matrix2<S>

source§

fn from(b: Basis2<S>) -> Matrix2<S>

Converts to this type from the input type.
source§

impl<S: BaseFloat> From<Matrix2<S>> for Matrix3<S>

source§

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

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

source§

impl<S: BaseFloat> From<Matrix2<S>> for Matrix4<S>

source§

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

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

source§

impl<S> Index<usize> for Matrix2<S>

§

type Output = Vector2<S>

The returned type after indexing.
source§

fn index<'a>(&'a self, i: usize) -> &'a Vector2<S>

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

impl<S> IndexMut<usize> for Matrix2<S>

source§

fn index_mut<'a>(&'a mut self, i: usize) -> &'a mut Vector2<S>

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

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

source§

fn into(self) -> [[S; 2]; 2]

Converts this type into the (usually inferred) input type.
source§

impl<S: BaseFloat> Matrix for Matrix2<S>

§

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
source§

fn row(&self, r: usize) -> Vector2<S>

Get a row from this matrix by-value.
source§

fn swap_rows(&mut self, a: usize, b: usize)

Swap two rows of this array.
source§

fn swap_columns(&mut self, a: usize, b: usize)

Swap two columns of this array.
source§

fn swap_elements(&mut self, a: (usize, usize), b: (usize, usize))

Swap the values at index a and b
source§

fn transpose(&self) -> Matrix2<S>

Transpose this matrix, returning a new matrix.
source§

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

Get the pointer to the first element of the array.
source§

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

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

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

Replace a column in the array.
source§

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

§

type Output = Matrix2<S>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Matrix2<S>) -> Matrix2<S>

Performs the * operation. Read more
source§

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

§

type Output = Matrix2<S>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Matrix2<S>) -> Matrix2<S>

Performs the * operation. Read more
source§

impl<'a> Mul<&'a Matrix2<f32>> for f32

§

type Output = Matrix2<f32>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Matrix2<f32>) -> Matrix2<f32>

Performs the * operation. Read more
source§

impl<'a> Mul<&'a Matrix2<f64>> for f64

§

type Output = Matrix2<f64>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Matrix2<f64>) -> Matrix2<f64>

Performs the * operation. Read more
source§

impl<'a> Mul<&'a Matrix2<i16>> for i16

§

type Output = Matrix2<i16>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Matrix2<i16>) -> Matrix2<i16>

Performs the * operation. Read more
source§

impl<'a> Mul<&'a Matrix2<i32>> for i32

§

type Output = Matrix2<i32>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Matrix2<i32>) -> Matrix2<i32>

Performs the * operation. Read more
source§

impl<'a> Mul<&'a Matrix2<i64>> for i64

§

type Output = Matrix2<i64>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Matrix2<i64>) -> Matrix2<i64>

Performs the * operation. Read more
source§

impl<'a> Mul<&'a Matrix2<i8>> for i8

§

type Output = Matrix2<i8>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Matrix2<i8>) -> Matrix2<i8>

Performs the * operation. Read more
source§

impl<'a> Mul<&'a Matrix2<isize>> for isize

§

type Output = Matrix2<isize>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Matrix2<isize>) -> Matrix2<isize>

Performs the * operation. Read more
source§

impl<'a> Mul<&'a Matrix2<u16>> for u16

§

type Output = Matrix2<u16>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Matrix2<u16>) -> Matrix2<u16>

Performs the * operation. Read more
source§

impl<'a> Mul<&'a Matrix2<u32>> for u32

§

type Output = Matrix2<u32>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Matrix2<u32>) -> Matrix2<u32>

Performs the * operation. Read more
source§

impl<'a> Mul<&'a Matrix2<u64>> for u64

§

type Output = Matrix2<u64>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Matrix2<u64>) -> Matrix2<u64>

Performs the * operation. Read more
source§

impl<'a> Mul<&'a Matrix2<u8>> for u8

§

type Output = Matrix2<u8>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Matrix2<u8>) -> Matrix2<u8>

Performs the * operation. Read more
source§

impl<'a> Mul<&'a Matrix2<usize>> for usize

§

type Output = Matrix2<usize>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Matrix2<usize>) -> Matrix2<usize>

Performs the * operation. Read more
source§

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

§

type Output = Vector2<S>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Vector2<S>) -> Vector2<S>

Performs the * operation. Read more
source§

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

§

type Output = Vector2<S>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Vector2<S>) -> Vector2<S>

Performs the * operation. Read more
source§

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

§

type Output = Matrix2<S>

The resulting type after applying the * operator.
source§

fn mul(self, other: Matrix2<S>) -> Matrix2<S>

Performs the * operation. Read more
source§

impl<S: BaseFloat> Mul<Matrix2<S>> for Matrix2<S>

§

type Output = Matrix2<S>

The resulting type after applying the * operator.
source§

fn mul(self, other: Matrix2<S>) -> Matrix2<S>

Performs the * operation. Read more
source§

impl Mul<Matrix2<f32>> for f32

§

type Output = Matrix2<f32>

The resulting type after applying the * operator.
source§

fn mul(self, other: Matrix2<f32>) -> Matrix2<f32>

Performs the * operation. Read more
source§

impl Mul<Matrix2<f64>> for f64

§

type Output = Matrix2<f64>

The resulting type after applying the * operator.
source§

fn mul(self, other: Matrix2<f64>) -> Matrix2<f64>

Performs the * operation. Read more
source§

impl Mul<Matrix2<i16>> for i16

§

type Output = Matrix2<i16>

The resulting type after applying the * operator.
source§

fn mul(self, other: Matrix2<i16>) -> Matrix2<i16>

Performs the * operation. Read more
source§

impl Mul<Matrix2<i32>> for i32

§

type Output = Matrix2<i32>

The resulting type after applying the * operator.
source§

fn mul(self, other: Matrix2<i32>) -> Matrix2<i32>

Performs the * operation. Read more
source§

impl Mul<Matrix2<i64>> for i64

§

type Output = Matrix2<i64>

The resulting type after applying the * operator.
source§

fn mul(self, other: Matrix2<i64>) -> Matrix2<i64>

Performs the * operation. Read more
source§

impl Mul<Matrix2<i8>> for i8

§

type Output = Matrix2<i8>

The resulting type after applying the * operator.
source§

fn mul(self, other: Matrix2<i8>) -> Matrix2<i8>

Performs the * operation. Read more
source§

impl Mul<Matrix2<isize>> for isize

§

type Output = Matrix2<isize>

The resulting type after applying the * operator.
source§

fn mul(self, other: Matrix2<isize>) -> Matrix2<isize>

Performs the * operation. Read more
source§

impl Mul<Matrix2<u16>> for u16

§

type Output = Matrix2<u16>

The resulting type after applying the * operator.
source§

fn mul(self, other: Matrix2<u16>) -> Matrix2<u16>

Performs the * operation. Read more
source§

impl Mul<Matrix2<u32>> for u32

§

type Output = Matrix2<u32>

The resulting type after applying the * operator.
source§

fn mul(self, other: Matrix2<u32>) -> Matrix2<u32>

Performs the * operation. Read more
source§

impl Mul<Matrix2<u64>> for u64

§

type Output = Matrix2<u64>

The resulting type after applying the * operator.
source§

fn mul(self, other: Matrix2<u64>) -> Matrix2<u64>

Performs the * operation. Read more
source§

impl Mul<Matrix2<u8>> for u8

§

type Output = Matrix2<u8>

The resulting type after applying the * operator.
source§

fn mul(self, other: Matrix2<u8>) -> Matrix2<u8>

Performs the * operation. Read more
source§

impl Mul<Matrix2<usize>> for usize

§

type Output = Matrix2<usize>

The resulting type after applying the * operator.
source§

fn mul(self, other: Matrix2<usize>) -> Matrix2<usize>

Performs the * operation. Read more
source§

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

§

type Output = Matrix2<S>

The resulting type after applying the * operator.
source§

fn mul(self, other: S) -> Matrix2<S>

Performs the * operation. Read more
source§

impl<S: BaseFloat> Mul<S> for Matrix2<S>

§

type Output = Matrix2<S>

The resulting type after applying the * operator.
source§

fn mul(self, other: S) -> Matrix2<S>

Performs the * operation. Read more
source§

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

§

type Output = Vector2<S>

The resulting type after applying the * operator.
source§

fn mul(self, other: Vector2<S>) -> Vector2<S>

Performs the * operation. Read more
source§

impl<S: BaseFloat> Mul<Vector2<S>> for Matrix2<S>

§

type Output = Vector2<S>

The resulting type after applying the * operator.
source§

fn mul(self, other: Vector2<S>) -> Vector2<S>

Performs the * operation. Read more
source§

impl<S: BaseFloat + MulAssign<S>> MulAssign<S> for Matrix2<S>

source§

fn mul_assign(&mut self, scalar: S)

Performs the *= operation. Read more
source§

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

§

type Output = Matrix2<S>

The resulting type after applying the - operator.
source§

fn neg(self) -> Matrix2<S>

Performs the unary - operation. Read more
source§

impl<S: BaseFloat> Neg for Matrix2<S>

§

type Output = Matrix2<S>

The resulting type after applying the - operator.
source§

fn neg(self) -> Matrix2<S>

Performs the unary - operation. Read more
source§

impl<S: BaseFloat> One for Matrix2<S>

source§

fn one() -> Matrix2<S>

Returns the multiplicative identity element of Self, 1. Read more
source§

fn set_one(&mut self)

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

fn is_one(&self) -> boolwhere Self: PartialEq<Self>,

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

impl<S: PartialEq + Copy> PartialEq<Matrix2<S>> for Matrix2<S>

source§

fn eq(&self, other: &Matrix2<S>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<S: BaseFloat + Rand> Rand for Matrix2<S>

source§

fn rand<R: Rng>(rng: &mut R) -> Matrix2<S>

Generates a random instance of this type using the specified source of randomness.
source§

impl<'a> Rem<&'a Matrix2<f32>> for f32

§

type Output = Matrix2<f32>

The resulting type after applying the % operator.
source§

fn rem(self, other: &'a Matrix2<f32>) -> Matrix2<f32>

Performs the % operation. Read more
source§

impl<'a> Rem<&'a Matrix2<f64>> for f64

§

type Output = Matrix2<f64>

The resulting type after applying the % operator.
source§

fn rem(self, other: &'a Matrix2<f64>) -> Matrix2<f64>

Performs the % operation. Read more
source§

impl<'a> Rem<&'a Matrix2<i16>> for i16

§

type Output = Matrix2<i16>

The resulting type after applying the % operator.
source§

fn rem(self, other: &'a Matrix2<i16>) -> Matrix2<i16>

Performs the % operation. Read more
source§

impl<'a> Rem<&'a Matrix2<i32>> for i32

§

type Output = Matrix2<i32>

The resulting type after applying the % operator.
source§

fn rem(self, other: &'a Matrix2<i32>) -> Matrix2<i32>

Performs the % operation. Read more
source§

impl<'a> Rem<&'a Matrix2<i64>> for i64

§

type Output = Matrix2<i64>

The resulting type after applying the % operator.
source§

fn rem(self, other: &'a Matrix2<i64>) -> Matrix2<i64>

Performs the % operation. Read more
source§

impl<'a> Rem<&'a Matrix2<i8>> for i8

§

type Output = Matrix2<i8>

The resulting type after applying the % operator.
source§

fn rem(self, other: &'a Matrix2<i8>) -> Matrix2<i8>

Performs the % operation. Read more
source§

impl<'a> Rem<&'a Matrix2<isize>> for isize

§

type Output = Matrix2<isize>

The resulting type after applying the % operator.
source§

fn rem(self, other: &'a Matrix2<isize>) -> Matrix2<isize>

Performs the % operation. Read more
source§

impl<'a> Rem<&'a Matrix2<u16>> for u16

§

type Output = Matrix2<u16>

The resulting type after applying the % operator.
source§

fn rem(self, other: &'a Matrix2<u16>) -> Matrix2<u16>

Performs the % operation. Read more
source§

impl<'a> Rem<&'a Matrix2<u32>> for u32

§

type Output = Matrix2<u32>

The resulting type after applying the % operator.
source§

fn rem(self, other: &'a Matrix2<u32>) -> Matrix2<u32>

Performs the % operation. Read more
source§

impl<'a> Rem<&'a Matrix2<u64>> for u64

§

type Output = Matrix2<u64>

The resulting type after applying the % operator.
source§

fn rem(self, other: &'a Matrix2<u64>) -> Matrix2<u64>

Performs the % operation. Read more
source§

impl<'a> Rem<&'a Matrix2<u8>> for u8

§

type Output = Matrix2<u8>

The resulting type after applying the % operator.
source§

fn rem(self, other: &'a Matrix2<u8>) -> Matrix2<u8>

Performs the % operation. Read more
source§

impl<'a> Rem<&'a Matrix2<usize>> for usize

§

type Output = Matrix2<usize>

The resulting type after applying the % operator.
source§

fn rem(self, other: &'a Matrix2<usize>) -> Matrix2<usize>

Performs the % operation. Read more
source§

impl Rem<Matrix2<f32>> for f32

§

type Output = Matrix2<f32>

The resulting type after applying the % operator.
source§

fn rem(self, other: Matrix2<f32>) -> Matrix2<f32>

Performs the % operation. Read more
source§

impl Rem<Matrix2<f64>> for f64

§

type Output = Matrix2<f64>

The resulting type after applying the % operator.
source§

fn rem(self, other: Matrix2<f64>) -> Matrix2<f64>

Performs the % operation. Read more
source§

impl Rem<Matrix2<i16>> for i16

§

type Output = Matrix2<i16>

The resulting type after applying the % operator.
source§

fn rem(self, other: Matrix2<i16>) -> Matrix2<i16>

Performs the % operation. Read more
source§

impl Rem<Matrix2<i32>> for i32

§

type Output = Matrix2<i32>

The resulting type after applying the % operator.
source§

fn rem(self, other: Matrix2<i32>) -> Matrix2<i32>

Performs the % operation. Read more
source§

impl Rem<Matrix2<i64>> for i64

§

type Output = Matrix2<i64>

The resulting type after applying the % operator.
source§

fn rem(self, other: Matrix2<i64>) -> Matrix2<i64>

Performs the % operation. Read more
source§

impl Rem<Matrix2<i8>> for i8

§

type Output = Matrix2<i8>

The resulting type after applying the % operator.
source§

fn rem(self, other: Matrix2<i8>) -> Matrix2<i8>

Performs the % operation. Read more
source§

impl Rem<Matrix2<isize>> for isize

§

type Output = Matrix2<isize>

The resulting type after applying the % operator.
source§

fn rem(self, other: Matrix2<isize>) -> Matrix2<isize>

Performs the % operation. Read more
source§

impl Rem<Matrix2<u16>> for u16

§

type Output = Matrix2<u16>

The resulting type after applying the % operator.
source§

fn rem(self, other: Matrix2<u16>) -> Matrix2<u16>

Performs the % operation. Read more
source§

impl Rem<Matrix2<u32>> for u32

§

type Output = Matrix2<u32>

The resulting type after applying the % operator.
source§

fn rem(self, other: Matrix2<u32>) -> Matrix2<u32>

Performs the % operation. Read more
source§

impl Rem<Matrix2<u64>> for u64

§

type Output = Matrix2<u64>

The resulting type after applying the % operator.
source§

fn rem(self, other: Matrix2<u64>) -> Matrix2<u64>

Performs the % operation. Read more
source§

impl Rem<Matrix2<u8>> for u8

§

type Output = Matrix2<u8>

The resulting type after applying the % operator.
source§

fn rem(self, other: Matrix2<u8>) -> Matrix2<u8>

Performs the % operation. Read more
source§

impl Rem<Matrix2<usize>> for usize

§

type Output = Matrix2<usize>

The resulting type after applying the % operator.
source§

fn rem(self, other: Matrix2<usize>) -> Matrix2<usize>

Performs the % operation. Read more
source§

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

§

type Output = Matrix2<S>

The resulting type after applying the % operator.
source§

fn rem(self, other: S) -> Matrix2<S>

Performs the % operation. Read more
source§

impl<S: BaseFloat> Rem<S> for Matrix2<S>

§

type Output = Matrix2<S>

The resulting type after applying the % operator.
source§

fn rem(self, other: S) -> Matrix2<S>

Performs the % operation. Read more
source§

impl<S: BaseFloat + RemAssign<S>> RemAssign<S> for Matrix2<S>

source§

fn rem_assign(&mut self, scalar: S)

Performs the %= operation. Read more
source§

impl<S: BaseFloat> SquareMatrix for Matrix2<S>

§

type ColumnRow = Vector2<S>

The row/column vector of the matrix. Read more
source§

fn from_value(value: S) -> Matrix2<S>

Create a new diagonal matrix using the supplied value.
source§

fn from_diagonal(value: Vector2<S>) -> Matrix2<S>

Create a matrix from a non-uniform scale
source§

fn transpose_self(&mut self)

Transpose this matrix in-place.
source§

fn determinant(&self) -> S

Take the determinant of this matrix.
source§

fn diagonal(&self) -> Vector2<S>

Return a vector containing the diagonal of this matrix.
source§

fn invert(&self) -> Option<Matrix2<S>>

Invert this matrix, returning a new matrix. m.mul_m(m.invert()) is the identity matrix. Returns None if this matrix is not invertible (has a determinant of zero).
source§

fn is_diagonal(&self) -> bool

Test if this is a diagonal matrix. That is, every element outside of the diagonal is 0.
source§

fn is_symmetric(&self) -> bool

Test if this matrix is symmetric. That is, it is equal to its transpose.
source§

fn identity() -> Self

The identity matrix. Multiplying this matrix with another should have no effect. Read more
source§

fn trace(&self) -> Self::Scalar

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

fn is_invertible(&self) -> bool

Test if this matrix is invertible.
source§

fn is_identity(&self) -> bool

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

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

§

type Output = Matrix2<S>

The resulting type after applying the - operator.
source§

fn sub(self, other: &'a Matrix2<S>) -> Matrix2<S>

Performs the - operation. Read more
source§

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

§

type Output = Matrix2<S>

The resulting type after applying the - operator.
source§

fn sub(self, other: &'a Matrix2<S>) -> Matrix2<S>

Performs the - operation. Read more
source§

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

§

type Output = Matrix2<S>

The resulting type after applying the - operator.
source§

fn sub(self, other: Matrix2<S>) -> Matrix2<S>

Performs the - operation. Read more
source§

impl<S: BaseFloat> Sub<Matrix2<S>> for Matrix2<S>

§

type Output = Matrix2<S>

The resulting type after applying the - operator.
source§

fn sub(self, other: Matrix2<S>) -> Matrix2<S>

Performs the - operation. Read more
source§

impl<S: BaseFloat + SubAssign<S>> SubAssign<Matrix2<S>> for Matrix2<S>

source§

fn sub_assign(&mut self, other: Matrix2<S>)

Performs the -= operation. Read more
source§

impl<S: BaseFloat> VectorSpace for Matrix2<S>

§

type Scalar = S

The associated scalar.
source§

impl<S: BaseFloat> Zero for Matrix2<S>

source§

fn zero() -> Matrix2<S>

Returns the additive identity element of Self, 0. Read more
source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
source§

fn set_zero(&mut self)

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

impl<S: Copy> Copy for Matrix2<S>

source§

impl<S> StructuralPartialEq for Matrix2<S>

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. 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 Twhere 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> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
source§

impl<T, Rhs> NumAssignOps<Rhs> for Twhere T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for Twhere T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,