Struct ami::Mat2 [−][src]
Single-precision 2x2 column major matrix.
Fields
m00: f32
m01: f32
m10: f32
m11: f32
Methods
impl Mat2
[src]
impl Mat2
pub fn new(m00: f32, m01: f32, m10: f32, m11: f32) -> Mat2
[src]
pub fn new(m00: f32, m01: f32, m10: f32, m11: f32) -> Mat2
Full constructor.
pub fn identity() -> Mat2
[src]
pub fn identity() -> Mat2
Identity constructor.
pub fn diagonal(di: f32) -> Mat2
[src]
pub fn diagonal(di: f32) -> Mat2
Diagonal constructor.
pub fn tridiagonal(lo: f32, di: f32, up: f32) -> Mat2
[src]
pub fn tridiagonal(lo: f32, di: f32, up: f32) -> Mat2
Tri-diagonal constructor.
impl Mat2
[src]
impl Mat2
pub fn determinant(self) -> f32
[src]
pub fn determinant(self) -> f32
Computes the matrix determinant.
pub fn trace(self) -> f32
[src]
pub fn trace(self) -> f32
Computes the matrix trace.
pub fn inverse(self) -> Mat2
[src]
pub fn inverse(self) -> Mat2
Computes the matrix inverse.
Panics
Panics if the matrix has no inverse (i.e. has zero determinant).
pub fn transpose(self) -> Mat2
[src]
pub fn transpose(self) -> Mat2
Returns the matrix transpose.
pub fn try_invert(self) -> Option<Mat2>
[src]
pub fn try_invert(self) -> Option<Mat2>
Attempts to compute the matrix inverse, returning None
if the matrix is
non-invertible (i.e. has zero determinant).
Trait Implementations
impl Into<[[f32; 2]; 2]> for Mat2
[src]
impl Into<[[f32; 2]; 2]> for Mat2
impl ApproxEq for Mat2
[src]
impl ApproxEq for Mat2
type Epsilon = <Matrix2<f32> as ApproxEq>::Epsilon
Used for specifying relative comparisons.
fn default_epsilon() -> <Mat2 as ApproxEq>::Epsilon
[src]
fn default_epsilon() -> <Mat2 as ApproxEq>::Epsilon
The default tolerance to use when testing values that are close together. Read more
fn default_max_relative() -> <Mat2 as ApproxEq>::Epsilon
[src]
fn default_max_relative() -> <Mat2 as ApproxEq>::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
fn default_max_ulps() -> u32
[src]
fn default_max_ulps() -> u32
The default ULPs to tolerate when testing values that are far-apart. Read more
fn relative_eq(
&self,
other: &Mat2,
epsilon: <Mat2 as ApproxEq>::Epsilon,
max_relative: <Mat2 as ApproxEq>::Epsilon
) -> bool
[src]
fn relative_eq(
&self,
other: &Mat2,
epsilon: <Mat2 as ApproxEq>::Epsilon,
max_relative: <Mat2 as ApproxEq>::Epsilon
) -> bool
A test for equality that uses a relative comparison if the values are far apart.
fn ulps_eq(
&self,
other: &Mat2,
epsilon: <Mat2 as ApproxEq>::Epsilon,
max_ulps: u32
) -> bool
[src]
fn ulps_eq(
&self,
other: &Mat2,
epsilon: <Mat2 as ApproxEq>::Epsilon,
max_ulps: u32
) -> bool
A test for equality that uses units in the last place (ULP) if the values are far apart.
fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
The inverse of ApproxEq::relative_eq
.
fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
The inverse of ApproxEq::ulps_eq
.
impl Add<Mat2> for Mat2
[src]
impl Add<Mat2> for Mat2
type Output = Mat2
The resulting type after applying the +
operator.
fn add(self, rhs: Mat2) -> <Mat2 as Add<Mat2>>::Output
[src]
fn add(self, rhs: Mat2) -> <Mat2 as Add<Mat2>>::Output
Performs the +
operation.
impl Sub<Mat2> for Mat2
[src]
impl Sub<Mat2> for Mat2
type Output = Mat2
The resulting type after applying the -
operator.
fn sub(self, rhs: Mat2) -> <Mat2 as Sub<Mat2>>::Output
[src]
fn sub(self, rhs: Mat2) -> <Mat2 as Sub<Mat2>>::Output
Performs the -
operation.
impl Display for Mat2
[src]
impl Display for Mat2
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl Clone for Mat2
[src]
impl Clone for Mat2
fn clone(&self) -> Mat2
[src]
fn clone(&self) -> Mat2
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Default for Mat2
[src]
impl Default for Mat2
impl Debug for Mat2
[src]
impl Debug for Mat2
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl Mul<Mat2> for f32
[src]
impl Mul<Mat2> for f32
type Output = Mat2
The resulting type after applying the *
operator.
fn mul(self, rhs: Mat2) -> <f32 as Mul<Mat2>>::Output
[src]
fn mul(self, rhs: Mat2) -> <f32 as Mul<Mat2>>::Output
Performs the *
operation.
impl Mul<Mat2> for Mat2
[src]
impl Mul<Mat2> for Mat2
type Output = Mat2
The resulting type after applying the *
operator.
fn mul(self, rhs: Mat2) -> <Mat2 as Mul<Mat2>>::Output
[src]
fn mul(self, rhs: Mat2) -> <Mat2 as Mul<Mat2>>::Output
Performs the *
operation.
impl Mul<Vec2> for Mat2
[src]
impl Mul<Vec2> for Mat2
type Output = Vec2
The resulting type after applying the *
operator.
fn mul(self, rhs: Vec2) -> <Mat2 as Mul<Vec2>>::Output
[src]
fn mul(self, rhs: Vec2) -> <Mat2 as Mul<Vec2>>::Output
Performs the *
operation.
impl Mul<f32> for Mat2
[src]
impl Mul<f32> for Mat2
type Output = Mat2
The resulting type after applying the *
operator.
fn mul(self, rhs: f32) -> <Mat2 as Mul<f32>>::Output
[src]
fn mul(self, rhs: f32) -> <Mat2 as Mul<f32>>::Output
Performs the *
operation.
impl<'a> Mul<Vec2> for &'a Mat2
[src]
impl<'a> Mul<Vec2> for &'a Mat2
type Output = Vec2
The resulting type after applying the *
operator.
fn mul(self, rhs: Vec2) -> <&'a Mat2 as Mul<Vec2>>::Output
[src]
fn mul(self, rhs: Vec2) -> <&'a Mat2 as Mul<Vec2>>::Output
Performs the *
operation.
impl Copy for Mat2
[src]
impl Copy for Mat2
impl AsRef<[[f32; 2]; 2]> for Mat2
[src]
impl AsRef<[[f32; 2]; 2]> for Mat2
impl PartialEq<Mat2> for Mat2
[src]
impl PartialEq<Mat2> for Mat2
fn eq(&self, other: &Mat2) -> bool
[src]
fn eq(&self, other: &Mat2) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Mat2) -> bool
[src]
fn ne(&self, other: &Mat2) -> bool
This method tests for !=
.
impl From<DMat4> for Mat2
[src]
impl From<DMat4> for Mat2
impl From<Mat2> for Mat3
[src]
impl From<Mat2> for Mat3
impl From<Mat2> for Mat4
[src]
impl From<Mat2> for Mat4
impl From<Mat2> for DMat4
[src]
impl From<Mat2> for DMat4
impl From<Mat4> for Mat2
[src]
impl From<Mat4> for Mat2
impl From<DMat3> for Mat2
[src]
impl From<DMat3> for Mat2
impl From<Mat2> for DMat2
[src]
impl From<Mat2> for DMat2
impl From<[[f32; 2]; 2]> for Mat2
[src]
impl From<[[f32; 2]; 2]> for Mat2
impl From<DMat2> for Mat2
[src]
impl From<DMat2> for Mat2
impl From<f64> for Mat2
[src]
impl From<f64> for Mat2
impl From<Mat2> for DMat3
[src]
impl From<Mat2> for DMat3
impl From<Mat3> for Mat2
[src]
impl From<Mat3> for Mat2
impl From<f32> for Mat2
[src]
impl From<f32> for Mat2