Struct matriarch::Mat2[][src]

pub struct Mat2 {
    pub a: f32,
    pub b: f32,
    pub c: f32,
    pub d: f32,
}

A 2x2 Matrix with elements arranged in row-major order.

A Mat2 is laid out as follows:

    [ a  b ]
A = [ c  d ]

Fields

Methods

impl Mat2
[src]

Returns a new array with all elements set to 0.0

Returns an identity matrix.

Creates a new Mat2 using the borrowed values.

Creates a new Mat2 from a row-major ordered array.

Creates a Mat2 from a column-major ordered array.

Returns an array of the Mat2 elements in row-major order.

Returns an array of the Mat2 elements in column-major order.

Returns the matrix as an array of Vec2 columns

Returns the determinant of a Mat2.

Returns a new Mat2 that is the tranpose of the original Mat2.

Trait Implementations

impl Clone for Mat2
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Mat2
[src]

impl Debug for Mat2
[src]

Formats the value using the given formatter. Read more

impl Default for Mat2
[src]

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

impl PartialEq for Mat2
[src]

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

This method tests for !=.

impl Mul<Mat2> for Mat2
[src]

The resulting type after applying the * operator.

Multiplies two Mat2s together, returning a new Mat2.

Keep in mind that matrix multiplication is not commutative, such that A*B != B*A for most matrices (the main exception being the Identity matrix)

Example:

let some_mat2 = mat2 * some_other_mat2;

impl Mul<Vec2> for Mat2
[src]

The resulting type after applying the * operator.

Multiplies a Mat2 by a Vec2, returning a Vec2.

impl Mul<Mat2> for f32
[src]

The resulting type after applying the * operator.

Multiplies a Mat2 and a scalar together and returns the Mat2.

Example:

let scalar = 2.0;
let some_mat2 = Mat2::identity();
let result = scalar * some_mat2;

Auto Trait Implementations

impl Send for Mat2

impl Sync for Mat2