Options
All
• Public
• Public/Protected
• All

# Namespace mat3

## Functions

#### Parameters

• ##### out: mat3

the receiving matrix

the first operand

the second operand

#### Returns mat3

out

• Calculates the adjugate of a mat3

#### Parameters

• ##### out: mat3

the receiving matrix

the source matrix

out

### clone

• Creates a new mat3 initialized with values from an existing matrix

#### Parameters

matrix to clone

#### Returns mat3

a new 3x3 matrix

### copy

• copy(out: mat3, a: ReadonlyMat3): mat3
• Copy the values from one mat3 to another

#### Parameters

• ##### out: mat3

the receiving matrix

the source matrix

out

### create

• Creates a new identity mat3

#### Returns mat3

a new 3x3 matrix

### determinant

• Calculates the determinant of a mat3

#### Parameters

the source matrix

#### Returns number

determinant of a

### equals

• Returns whether or not the matrices have approximately the same elements in the same position.

#### Parameters

The first matrix.

The second matrix.

#### Returns boolean

True if the matrices are equal, false otherwise.

### exactEquals

• Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)

#### Parameters

The first matrix.

The second matrix.

#### Returns boolean

True if the matrices are equal, false otherwise.

### frob

• Returns Frobenius norm of a mat3

#### Parameters

the matrix to calculate Frobenius norm of

#### Returns number

Frobenius norm

### fromMat2d

• fromMat2d(out: mat3, a: ReadonlyMat2d): mat3
• Copies the values from a mat2d into a mat3

#### Parameters

• ##### out: mat3

the receiving matrix

the matrix to copy

out

### fromMat4

• fromMat4(out: mat3, a: ReadonlyMat4): mat3
• Copies the upper-left 3x3 values into the given mat3.

#### Parameters

• ##### out: mat3

the receiving 3x3 matrix

the source 4x4 matrix

out

### fromQuat

• fromQuat(out: mat3, q: ReadonlyQuat): mat3
• Calculates a 3x3 matrix from the given quaternion

#### Parameters

• ##### out: mat3

mat3 receiving operation result

Quaternion to create matrix from

out

### fromRotation

• fromRotation(out: mat3, rad: number): mat3
• Creates a matrix from a given angle This is equivalent to (but much faster than):

``````mat3.identity(dest);
``````

#### Parameters

• ##### out: mat3

mat3 receiving operation result

the angle to rotate the matrix by

out

### fromScaling

• fromScaling(out: mat3, v: ReadonlyVec2): mat3
• Creates a matrix from a vector scaling This is equivalent to (but much faster than):

``````mat3.identity(dest);
mat3.scale(dest, dest, vec);
``````

#### Parameters

• ##### out: mat3

mat3 receiving operation result

Scaling vector

out

### fromTranslation

• fromTranslation(out: mat3, v: ReadonlyVec2): mat3
• Creates a matrix from a vector translation This is equivalent to (but much faster than):

``````mat3.identity(dest);
mat3.translate(dest, dest, vec);
``````

#### Parameters

• ##### out: mat3

mat3 receiving operation result

Translation vector

out

### fromValues

• fromValues(m00: number, m01: number, m02: number, m10: number, m11: number, m12: number, m20: number, m21: number, m22: number): mat3
• Create a new mat3 with the given values

#### Parameters

• ##### m00: number

Component in column 0, row 0 position (index 0)

• ##### m01: number

Component in column 0, row 1 position (index 1)

• ##### m02: number

Component in column 0, row 2 position (index 2)

• ##### m10: number

Component in column 1, row 0 position (index 3)

• ##### m11: number

Component in column 1, row 1 position (index 4)

• ##### m12: number

Component in column 1, row 2 position (index 5)

• ##### m20: number

Component in column 2, row 0 position (index 6)

• ##### m21: number

Component in column 2, row 1 position (index 7)

• ##### m22: number

Component in column 2, row 2 position (index 8)

A new mat3

### identity

• Set a mat3 to the identity matrix

#### Parameters

• ##### out: mat3

the receiving matrix

out

### invert

• invert(out: mat3, a: ReadonlyMat3): mat3
• Inverts a mat3

#### Parameters

• ##### out: mat3

the receiving matrix

the source matrix

out

### mul

• Multiplies two mat3's

#### Parameters

• ##### out: mat3

the receiving matrix

the first operand

the second operand

out

### multiply

• Multiplies two mat3's

#### Parameters

• ##### out: mat3

the receiving matrix

the first operand

the second operand

out

### multiplyScalar

• multiplyScalar(out: mat3, a: ReadonlyMat3, b: number): mat3
• Multiply each element of the matrix by a scalar.

#### Parameters

• ##### out: mat3

the receiving matrix

the matrix to scale

• ##### b: number

amount to scale the matrix's elements by

#### Returns mat3

out

• Adds two mat3's after multiplying each element of the second operand by a scalar value.

#### Parameters

• ##### out: mat3

the receiving vector

the first operand

the second operand

• ##### scale: number

the amount to scale b's elements by before adding

out

### normalFromMat4

• normalFromMat4(out: mat3, a: ReadonlyMat4): mat3
• Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix

#### Parameters

• ##### out: mat3

mat3 receiving operation result

Mat4 to derive the normal matrix from

out

### projection

• projection(out: mat3, width: number, height: number): mat3
• Generates a 2D projection matrix with the given bounds

#### Parameters

• ##### out: mat3

mat3 frustum matrix will be written into

• ##### height: number

Height of gl context

out

### rotate

• Rotates a mat3 by the given angle

#### Parameters

• ##### out: mat3

the receiving matrix

the matrix to rotate

the angle to rotate the matrix by

out

### scale

• Scales the mat3 by the dimensions in the given vec2

#### Parameters

• ##### out: mat3

the receiving matrix

the matrix to rotate

the vec2 to scale the matrix by

out

### set

• set(out: mat3, m00: number, m01: number, m02: number, m10: number, m11: number, m12: number, m20: number, m21: number, m22: number): mat3
• Set the components of a mat3 to the given values

#### Parameters

• ##### out: mat3

the receiving matrix

• ##### m00: number

Component in column 0, row 0 position (index 0)

• ##### m01: number

Component in column 0, row 1 position (index 1)

• ##### m02: number

Component in column 0, row 2 position (index 2)

• ##### m10: number

Component in column 1, row 0 position (index 3)

• ##### m11: number

Component in column 1, row 1 position (index 4)

• ##### m12: number

Component in column 1, row 2 position (index 5)

• ##### m20: number

Component in column 2, row 0 position (index 6)

• ##### m21: number

Component in column 2, row 1 position (index 7)

• ##### m22: number

Component in column 2, row 2 position (index 8)

out

### str

• Returns a string representation of a mat3

#### Parameters

matrix to represent as a string

#### Returns string

string representation of the matrix

### sub

• Subtracts matrix b from matrix a

#### Parameters

• ##### out: mat3

the receiving matrix

the first operand

the second operand

out

### subtract

• Subtracts matrix b from matrix a

#### Parameters

• ##### out: mat3

the receiving matrix

the first operand

the second operand

out

### translate

• Translate a mat3 by the given vector

#### Parameters

• ##### out: mat3

the receiving matrix

the matrix to translate

vector to translate by

out

### transpose

• transpose(out: mat3, a: ReadonlyMat3): mat3
• Transpose the values of a mat3

#### Parameters

• ##### out: mat3

the receiving matrix