API Docs for: 0.6.1
Show:

# Mat3 Class

A 3x3 matrix.

## Constructor

### `Mat3`

(
• `array`
)

#### Parameters:

• `array` Object

elements Array of nine elements. Optional.

## Methods

### `copy`

(
• `source`
)

Copy another matrix into this matrix object.

#### Parameters:

• `source` Mat3

Mat3:

this

### `e`

(
• `row`
• `column`
• `value`
)
Number

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.

Number:

### `getTrace`

()

Gets the matrix diagonal elements

Vec3:

### `identity`

()

Sets the matrix to identity

### `mmult`

(
• `m`
)

Matrix multiplication

#### Parameters:

• `m` Mat3

Matrix to multiply with from left side.

Mat3:

The result.

### `reverse`

(
• `target`
)

reverse the matrix

#### Parameters:

• `target` Mat3

Optional. Target matrix to save in.

Mat3:

The solution x

### `scale`

(
• `v`
)

Scale each column of the matrix

#### Parameters:

• `v` Vec3

Mat3:

The result.

### `setRotationFromQuaternion`

(
• `q`
)

Set the matrix from a quaterion

### `setTrace`

(
• `vec3`
)

Sets the matrix diagonal elements from a Vec3

#### Parameters:

• `vec3` Vec3

### `setZero`

()

Set all elements to zero

### `smult`

(
• `s`
)

Matrix-scalar multiplication

#### Parameters:

• `s` Number

### `solve`

(
• `b`
• `target`
)

Solve Ax=b

#### Parameters:

• `b` Vec3

The right hand side

• `target` Vec3

Optional. Target vector to save in.

Vec3:

The solution x

### `toString`

()

Returns a string representation of the matrix.

string

### `transpose`

(
• `target`
)

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`
)

Matrix-Vector multiplication

#### Parameters:

• `v` Vec3

The vector to multiply with

• `target` Vec3

Optional, target to save the result in.

## Properties

### `elements`

Array

A vector of length 9, containing all matrix elements