mat3

mat3()

3x3 Matrix

Methods

inneradd$2(out, a, b)mat3

Adds two mat3's
Name Type Description
out mat3 the receiving matrix
a mat3 the first operand
b mat3 the second operand
Returns:
out

inneradjoint$1(out, a)mat3

Calculates the adjugate of a mat3
Name Type Description
out mat3 the receiving matrix
a mat3 the source matrix
Returns:
out

innerclone$2(a)mat3

Creates a new mat3 initialized with values from an existing matrix
Name Type Description
a mat3 matrix to clone
Returns:
a new 3x3 matrix

innercopy$2(out, a)mat3

Copy the values from one mat3 to another
Name Type Description
out mat3 the receiving matrix
a mat3 the source matrix
Returns:
out

innercreate$2()mat3

Creates a new identity mat3
Returns:
a new 3x3 matrix

innerdeterminant$2(a)Number

Calculates the determinant of a mat3
Name Type Description
a mat3 the source matrix
Returns:
determinant of a

innerequals$3(a, b)Boolean

Returns whether or not the matrices have approximately the same elements in the same position.
Name Type Description
a mat3 The first matrix.
b mat3 The second matrix.
Returns:
True if the matrices are equal, false otherwise.

innerexactEquals$2(a, b)Boolean

Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)
Name Type Description
a mat3 The first matrix.
b mat3 The second matrix.
Returns:
True if the matrices are equal, false otherwise.

innerfrob$2(a)Number

Returns Frobenius norm of a mat3
Name Type Description
a mat3 the matrix to calculate Frobenius norm of
Returns:
Frobenius norm

innerfromMat2d(out, a)mat3

Copies the values from a mat2d into a mat3
Name Type Description
out mat3 the receiving matrix
a mat2d the matrix to copy
Returns:
out

innerfromMat4(out, a)mat3

Copies the upper-left 3x3 values into the given mat3.
Name Type Description
out mat3 the receiving 3x3 matrix
a mat4 the source 4x4 matrix
Returns:
out

innerfromQuat(out, q)mat3

Calculates a 3x3 matrix from the given quaternion
Name Type Description
out mat3 mat3 receiving operation result
q quat Quaternion to create matrix from
Returns:
out

innerfromRotation$2(out, rad)mat3

Creates a matrix from a given angle This is equivalent to (but much faster than): mat3.identity(dest); mat3.rotate(dest, dest, rad);
Name Type Description
out mat3 mat3 receiving operation result
rad Number the angle to rotate the matrix by
Returns:
out

innerfromScaling$2(out, v)mat3

Creates a matrix from a vector scaling This is equivalent to (but much faster than): mat3.identity(dest); mat3.scale(dest, dest, vec);
Name Type Description
out mat3 mat3 receiving operation result
v vec2 Scaling vector
Returns:
out

innerfromTranslation$1(out, v)mat3

Creates a matrix from a vector translation This is equivalent to (but much faster than): mat3.identity(dest); mat3.translate(dest, dest, vec);
Name Type Description
out mat3 mat3 receiving operation result
v vec2 Translation vector
Returns:
out

innerfromValues$2(m00, m01, m02, m10, m11, m12, m20, m21, m22)mat3

Create a new mat3 with the given values
Name Type Description
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)
Returns:
A new mat3

inneridentity$2(out)mat3

Set a mat3 to the identity matrix
Name Type Description
out mat3 the receiving matrix
Returns:
out

innerinvert$2(out, a)mat3

Inverts a mat3
Name Type Description
out mat3 the receiving matrix
a mat3 the source matrix
Returns:
out

innermul$2()

Alias for mat3.multiply

innermultiply$2(out, a, b)mat3

Multiplies two mat3's
Name Type Description
out mat3 the receiving matrix
a mat3 the first operand
b mat3 the second operand
Returns:
out

innermultiplyScalar$2(out, a, b)mat3

Multiply each element of the matrix by a scalar.
Name Type Description
out mat3 the receiving matrix
a mat3 the matrix to scale
b Number amount to scale the matrix's elements by
Returns:
out

innermultiplyScalarAndAdd$2(out, a, b, scale)mat3

Adds two mat3's after multiplying each element of the second operand by a scalar value.
Name Type Description
out mat3 the receiving vector
a mat3 the first operand
b mat3 the second operand
scale Number the amount to scale b's elements by before adding
Returns:
out

innernormalFromMat4(out, a)mat3

Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix
Name Type Description
out mat3 mat3 receiving operation result
a mat4 Mat4 to derive the normal matrix from
Returns:
out

innerprojection(out, width, height)mat3

Generates a 2D projection matrix with the given bounds
Name Type Description
out mat3 mat3 frustum matrix will be written into
width number Width of your gl context
height number Height of gl context
Returns:
out

innerrotate$2(out, a, rad)mat3

Rotates a mat3 by the given angle
Name Type Description
out mat3 the receiving matrix
a mat3 the matrix to rotate
rad Number the angle to rotate the matrix by
Returns:
out

innerscale$2(out, a, v)mat3

Scales the mat3 by the dimensions in the given vec2
Name Type Description
out mat3 the receiving matrix
a mat3 the matrix to rotate
v vec2 the vec2 to scale the matrix by
Returns:
out

innerset$2(out, m00, m01, m02, m10, m11, m12, m20, m21, m22)mat3

Set the components of a mat3 to the given values
Name Type Description
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)
Returns:
out

innerstr$2(a)String

Returns a string representation of a mat3
Name Type Description
a mat3 matrix to represent as a string
Returns:
string representation of the matrix

innersub$2()

Alias for mat3.subtract

innersubtract$2(out, a, b)mat3

Subtracts matrix b from matrix a
Name Type Description
out mat3 the receiving matrix
a mat3 the first operand
b mat3 the second operand
Returns:
out

innertranslate$1(out, a, v)mat3

Translate a mat3 by the given vector
Name Type Description
out mat3 the receiving matrix
a mat3 the matrix to translate
v vec2 vector to translate by
Returns:
out

innertranspose$1(out, a)mat3

Transpose the values of a mat3
Name Type Description
out mat3 the receiving matrix
a mat3 the source matrix
Returns:
out