# Struct siege_math::matrix::Mat2
[−]
[src]

#[repr(C)]pub struct Mat2<F> { pub x: Vec2<F>, pub y: Vec2<F>, }

A 2x2 matrix.

This matrix is internally stored column-major (as that is better for GPU compatibility and possibly other reasons), but the API (e.g. the order of function parameters to the new() function) is row-major, since that is how people write matrices on paper.

## Fields

`x: Vec2<F>`

`y: Vec2<F>`

## Methods

`impl<F: FullFloat> Mat2<F>`

[src]

`pub fn new(r0c0: F, r0c1: F, r1c0: F, r1c1: F) -> Mat2<F>`

[src]

Create a new 2x2 Matrix. Specify parameters in row-major order (as typically written on paper and in math texts)

`pub fn from_cols(x: Vec2<F>, y: Vec2<F>) -> Mat2<F>`

[src]

`impl<F: FullFloat> Mat2<F>`

[src]

`impl<F: FullFloat> Mat2<F>`

[src]

`impl<F: FullFloat> Mat2<F>`

[src]

`impl<F: FullFloat> Mat2<F>`

[src]

`impl<F: FullFloat> Mat2<F>`

[src]

`pub fn is_diagonal(&self) -> bool`

[src]

`impl<F: FullFloat> Mat2<F>`

[src]

`pub fn is_symmetric(&self) -> bool`

[src]

`impl<F: FullFloat> Mat2<F>`

[src]

`pub fn is_skew_symmetric(&self) -> bool`

[src]

`impl<F: FullFloat> Mat2<F>`

[src]

`pub fn from_angle(theta: Angle<F>) -> Mat2<F>`

[src]

## Trait Implementations

`impl<F: Debug> Debug for Mat2<F>`

[src]

`fn fmt(&self, __arg_0: &mut Formatter) -> Result`

[src]

Formats the value using the given formatter. Read more

`impl<F: Clone> Clone for Mat2<F>`

[src]

`fn clone(&self) -> Mat2<F>`

[src]

Returns a copy of the value. Read more

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

1.0.0[src]

Performs copy-assignment from `source`

. Read more

`impl<F: Copy> Copy for Mat2<F>`

[src]

`impl<F: PartialEq> PartialEq for Mat2<F>`

[src]

`fn eq(&self, __arg_0: &Mat2<F>) -> bool`

[src]

This method tests for `self`

and `other`

values to be equal, and is used by `==`

. Read more

`fn ne(&self, __arg_0: &Mat2<F>) -> bool`

[src]

This method tests for `!=`

.

`impl<F: Eq> Eq for Mat2<F>`

[src]

`impl<F: Hash> Hash for Mat2<F>`

[src]

`fn hash<__HF: Hasher>(&self, __arg_0: &mut __HF)`

[src]

Feeds this value into the given [`Hasher`

]. Read more

`fn hash_slice<H>(data: &[Self], state: &mut H) where`

H: Hasher,

1.3.0[src]

H: Hasher,

Feeds a slice of this type into the given [`Hasher`

]. Read more

`impl<F: FullFloat> Index<(usize, usize)> for Mat2<F>`

[src]

`type Output = F`

The returned type after indexing.

`fn index(&self, (row, col): (usize, usize)) -> &F`

[src]

Performs the indexing (`container[index]`

) operation.

`impl<F: FullFloat> IndexMut<(usize, usize)> for Mat2<F>`

[src]

`fn index_mut(&mut self, (row, col): (usize, usize)) -> &mut F`

[src]

Performs the mutable indexing (`container[index]`

) operation.

`impl<F: FullFloat> Default for Mat2<F>`

[src]

`impl<'a, 'b, F: FullFloat> Add<&'b Mat2<F>> for &'a Mat2<F>`

[src]

`type Output = Mat2<F>`

The resulting type after applying the `+`

operator.

`fn add(self, rhs: &Mat2<F>) -> Mat2<F>`

[src]

Performs the `+`

operation.

`impl<'a, F: FullFloat> Mul<F> for &'a Mat2<F>`

[src]

`type Output = Mat2<F>`

The resulting type after applying the `*`

operator.

`fn mul(self, rhs: F) -> Mat2<F>`

[src]

Performs the `*`

operation.

`impl<'a, 'b, F: FullFloat> Mul<&'b Mat2<F>> for &'a Mat2<F>`

[src]

`type Output = Mat2<F>`

The resulting type after applying the `*`

operator.

`fn mul(self, rhs: &Mat2<F>) -> Mat2<F>`

[src]

Performs the `*`

operation.

`impl<'a, 'b, F: FullFloat> Mul<&'a Vec2<F>> for &'b Mat2<F>`

[src]

`type Output = Vec2<F>`

The resulting type after applying the `*`

operator.

`fn mul(self, rhs: &Vec2<F>) -> Vec2<F>`

[src]

Performs the `*`

operation.

`impl<'a, 'b, F: FullFloat> Mul<&'a Mat2<F>> for &'a Vec2<F>`

[src]

`type Output = Vec2<F>`

The resulting type after applying the `*`

operator.

`fn mul(self, rhs: &Mat2<F>) -> Vec2<F>`

[src]

Performs the `*`

operation.

`impl<F: FullFloat> ApproxEq for Mat2<F>`

[src]

`type Flt = F`

`fn approx_eq(`

&self,

other: &Self,

epsilon: <F as ApproxEq>::Flt,

ulps: <<F as ApproxEq>::Flt as Ulps>::U

) -> bool

[src]

&self,

other: &Self,

epsilon: <F as ApproxEq>::Flt,

ulps: <<F as ApproxEq>::Flt as Ulps>::U

) -> bool

This method tests for `self`

and `other`

values to be approximately equal using two methods: epsilon and ulps. If the values differ by less than the given epsilon, they will be considered equal. If the values differ by more than epsilon, but by less than the given ulps, they will also be considered equal. Otherwise they are unequal. Read more

`fn approx_ne(`

&self,

other: &Self,

epsilon: Self::Flt,

ulps: <Self::Flt as Ulps>::U

) -> bool

[src]

&self,

other: &Self,

epsilon: Self::Flt,

ulps: <Self::Flt as Ulps>::U

) -> bool

This method tests for `self`

and `other`

values to be not approximately equal using two methods: epsilon and ulps. If the values differ by less than the given epsilon, they will be considered equal. If the values differ by more than epsilon, but by less than the given ulps, they will also be considered equal. Otherwise they are unequal. Read more