#

API Docs for: 0.6.0
Show: Inherited Protected Private Deprecated

# Mat3 Class

Defined in: `src/math/Mat3.js:5`

A 3x3 matrix.

## Constructor

### `Mat3`

(

- `array`

)

Defined in `src/math/Mat3.js:5`

#### Parameters:

- `array` Object

  elements Array of nine elements. Optional.

- Index
- Methods
- Properties

## Item Index

### Methods

- copy
- e
- identity
- mmult
- reverse
- scale
- setRotationFromQuaternion
- setTrace
- setTrace
- setZero
- smult
- solve
- toString
- transpose
- vmult

### Properties

- elements

## Methods

### `copy`

(

- `source`

)
Mat3

Defined in `src/math/Mat3.js:241`

Copy another matrix into this matrix object.

#### Parameters:

- `source` Mat3

#### Returns:

Mat3:

this

### `e`

(

- `row`
- `column`
- `value`

)
Number

Defined in `src/math/Mat3.js:224`

Get an element in the matrix by index. Index starts at 0, not 1!!!

#### Parameters:

- `row` Number
- `column` Number
- `value` Number

  Optional. If provided, the matrix element will be set to this value.

#### Returns:

Number:

### `identity`

()

Defined in `src/math/Mat3.js:24`

Sets the matrix to identity

### `mmult`

(

- `m`

)
Mat3

Defined in `src/math/Mat3.js:115`

Matrix multiplication

#### Parameters:

- `m` Mat3

  Matrix to multiply with from left side.

#### Returns:

Mat3:

The result.

### `reverse`

(

- `target`

)
Mat3

Defined in `src/math/Mat3.js:268`

reverse the matrix

#### Parameters:

- `target` Mat3

  Optional. Target matrix to save in.

#### Returns:

Mat3:

The solution x

### `scale`

(

- `v`

)
Mat3

Defined in `src/math/Mat3.js:135`

Scale each column of the matrix

#### Parameters:

- `v` Vec3

#### Returns:

Mat3:

The result.

### `setRotationFromQuaternion`

(

- `q`

)

Defined in `src/math/Mat3.js:372`

Set the matrix from a quaterion

#### Parameters:

- `q` Quaternion

### `setTrace`

()

Defined in `src/math/Mat3.js:72`

Sets the matrix diagonal elements from a Vec3

### `setTrace`

()

Defined in `src/math/Mat3.js:61`

Sets the matrix diagonal elements from a Vec3

### `setZero`

()

Defined in `src/math/Mat3.js:44`

Set all elements to zero

### `smult`

(

- `s`

)

Defined in `src/math/Mat3.js:104`

Matrix-scalar multiplication

#### Parameters:

- `s` Number

### `solve`

(

- `b`
- `target`

)
Vec3

Defined in `src/math/Mat3.js:153`

Solve Ax=b

#### Parameters:

- `b` Vec3

  The right hand side

- `target` Vec3

  Optional. Target vector to save in.

#### Returns:

Vec3:

The solution x

### `toString`

()

Defined in `src/math/Mat3.js:254`

Returns a string representation of the matrix.

#### Returns:

string

### `transpose`

(

- `target`

)
Mat3

Defined in `src/math/Mat3.js:400`

Transpose the matrix

#### Parameters:

- `target` Mat3

  Where to store the result.

#### Returns:

Mat3:

The target Mat3, or a new Mat3 if target was omitted.

### `vmult`

(

- `v`
- `target`

)

Defined in `src/math/Mat3.js:84`

Matrix-Vector multiplication

#### Parameters:

- `v` Vec3

  The vector to multiply with

- `target` Vec3

  Optional, target to save the result in.

## Properties

### `elements`

Array

Defined in `src/math/Mat3.js:13`

A vector of length 9, containing all matrix elements