# Struct euler::Mat4[−][src]

```#[repr(C)]
pub struct Mat4 {
pub m00: f32,
pub m01: f32,
pub m02: f32,
pub m03: f32,
pub m10: f32,
pub m11: f32,
pub m12: f32,
pub m13: f32,
pub m20: f32,
pub m21: f32,
pub m22: f32,
pub m23: f32,
pub m30: f32,
pub m31: f32,
pub m32: f32,
pub m33: f32,
}```

Single-precision 2x2 column major matrix.

## Methods

### `impl Mat4`[src]

#### `pub fn new(    m00: f32,     m01: f32,     m02: f32,     m03: f32,     m10: f32,     m11: f32,     m12: f32,     m13: f32,     m20: f32,     m21: f32,     m22: f32,     m23: f32,     m30: f32,     m31: f32,     m32: f32,     m33: f32) -> Self`[src]

Full constructor.

#### `pub fn identity() -> Self`[src]

Identity constructor.

#### `pub fn diagonal(di: f32) -> Self`[src]

Diagonal constructor.

#### `pub fn tridiagonal(lo: f32, di: f32, up: f32) -> Self`[src]

Tri-diagonal constructor.

### `impl Mat4`[src]

#### `pub fn determinant(self) -> f32`[src]

Computes the matrix determinant.

#### `pub fn trace(self) -> f32`[src]

Computes the matrix trace.

#### `pub fn inverse(self) -> Mat4`[src]

Computes the matrix inverse.

## Panics

Panics if the matrix has no inverse (i.e. has zero determinant).

#### `pub fn transpose(self) -> Mat4`[src]

Returns the matrix transpose.

#### `pub fn try_invert(self) -> Option<Mat4>`[src]

Attempts to compute the matrix inverse, returning `None` if the matrix is non-invertible (i.e. has zero determinant).

## Trait Implementations

### `impl From<Mat4> for Mat2`[src]

#### `fn from(arg: Mat4) -> Self`[src]

Performs the conversion.

### `impl From<Mat4> for DMat2`[src]

#### `fn from(arg: Mat4) -> Self`[src]

Performs the conversion.

### `impl From<Mat4> for Mat3`[src]

#### `fn from(arg: Mat4) -> Self`[src]

Performs the conversion.

### `impl From<Mat4> for DMat3`[src]

#### `fn from(arg: Mat4) -> Self`[src]

Performs the conversion.

### `impl Clone for Mat4`[src]

#### `fn clone(&self) -> Mat4`[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 Debug for Mat4`[src]

#### `fn fmt(&self, f: &mut Formatter) -> Result`[src]

Formats the value using the given formatter. Read more

### `impl PartialEq for Mat4`[src]

#### `fn eq(&self, other: &Mat4) -> bool`[src]

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

#### `fn ne(&self, other: &Mat4) -> bool`[src]

This method tests for `!=`.

### `impl Display for Mat4`[src]

#### `fn fmt(&self, f: &mut Formatter) -> Result`[src]

Formats the value using the given formatter. Read more

### `impl From<f32> for Mat4`[src]

#### `fn from(arg: f32) -> Self`[src]

Performs the conversion.

### `impl From<f64> for Mat4`[src]

#### `fn from(arg: f64) -> Self`[src]

Performs the conversion.

### `impl From<Mat2> for Mat4`[src]

#### `fn from(arg: Mat2) -> Self`[src]

Performs the conversion.

### `impl From<DMat2> for Mat4`[src]

#### `fn from(arg: DMat2) -> Self`[src]

Performs the conversion.

### `impl From<Mat3> for Mat4`[src]

#### `fn from(arg: Mat3) -> Self`[src]

Performs the conversion.

### `impl From<DMat3> for Mat4`[src]

#### `fn from(arg: DMat3) -> Self`[src]

Performs the conversion.

### `impl From<DMat4> for Mat4`[src]

#### `fn from(arg: DMat4) -> Self`[src]

Performs the conversion.

### `impl From<Mat4> for DMat4`[src]

#### `fn from(arg: Mat4) -> Self`[src]

Performs the conversion.

### `impl Add<Mat4> for Mat4`[src]

#### `type Output = Mat4`

The resulting type after applying the `+` operator.

#### `fn add(self, rhs: Mat4) -> Self::Output`[src]

Performs the `+` operation.

### `impl Sub<Mat4> for Mat4`[src]

#### `type Output = Mat4`

The resulting type after applying the `-` operator.

#### `fn sub(self, rhs: Mat4) -> Self::Output`[src]

Performs the `-` operation.

### `impl Mul<f32> for Mat4`[src]

#### `type Output = Mat4`

The resulting type after applying the `*` operator.

#### `fn mul(self, rhs: f32) -> Self::Output`[src]

Performs the `*` operation.

### `impl Mul<Vec4> for Mat4`[src]

#### `type Output = Vec4`

The resulting type after applying the `*` operator.

#### `fn mul(self, rhs: Vec4) -> Self::Output`[src]

Performs the `*` operation.

### `impl<'a> Mul<Vec4> for &'a Mat4`[src]

#### `type Output = Vec4`

The resulting type after applying the `*` operator.

#### `fn mul(self, rhs: Vec4) -> Self::Output`[src]

Performs the `*` operation.

### `impl Mul<Mat4> for f32`[src]

#### `type Output = Mat4`

The resulting type after applying the `*` operator.

#### `fn mul(self, rhs: Mat4) -> Self::Output`[src]

Performs the `*` operation.

### `impl Mul<Mat4> for Mat4`[src]

#### `type Output = Mat4`

The resulting type after applying the `*` operator.

#### `fn mul(self, rhs: Mat4) -> Self::Output`[src]

Performs the `*` operation.

### `impl Default for Mat4`[src]

#### `fn default() -> Self`[src]

Returns the "default value" for a type. Read more

### `impl AsRef<[[f32; 4]; 4]> for Mat4`[src]

#### `fn as_ref(&self) -> &[[f32; 4]; 4]`[src]

Performs the conversion.

### `impl From<[[f32; 4]; 4]> for Mat4`[src]

#### `fn from(array: [[f32; 4]; 4]) -> Self`[src]

Performs the conversion.

### `impl Into<[[f32; 4]; 4]> for Mat4`[src]

#### `fn into(self) -> [[f32; 4]; 4]`[src]

Performs the conversion.

### `impl ApproxEq for Mat4`[src]

#### `type Epsilon = <Matrix4<f32> as ApproxEq>::Epsilon`

Used for specifying relative comparisons.

#### `fn default_epsilon() -> Self::Epsilon`[src]

The default tolerance to use when testing values that are close together. Read more

#### `fn default_max_relative() -> Self::Epsilon`[src]

The default relative tolerance for testing values that are far-apart. Read more

#### `fn default_max_ulps() -> u32`[src]

The default ULPs to tolerate when testing values that are far-apart. Read more

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

A test for equality that uses a relative comparison if the values are far apart.

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

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`[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`.