Module: mat3

Summary

Methods

Detailed Description

Methods

adjoint(a, out) → {Mat3}

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

clone(a) → {Mat3}

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

copy(a, out) → {Mat3}

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

create() → {Mat3}

Creates a new identity mat3
Returns:
a new 3x3 matrix
Type
Mat3
Source:

determinant(a) → {Number}

Calculates the determinant of a mat3
Parameters:
Name Type Description
a Mat3 the source matrix
Returns:
determinant of a
Type
Number
Source:

frob(a) → {Number}

Returns Frobenius norm of a mat3
Parameters:
Name Type Description
a Mat3 the matrix to calculate Frobenius norm of
Returns:
Frobenius norm
Type
Number
Source:

fromMat2d(a, out) → {Mat3}

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

fromMat4(a, out) → {Mat3}

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

fromQuat(q, out) → {Mat3}

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

fromRotation(rad, out) → {Mat3}

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

fromScaling(v, out) → {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:
Name Type Description
v vec2 Scaling vector
out Mat3 mat3 receiving operation result
Returns:
out
Type
Mat3
Source:

fromTranslation(v, out) → {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:
Name Type Description
v vec2 Translation vector
out Mat3 mat3 receiving operation result
Returns:
out
Type
Mat3
Source:

identity(out) → {Mat3}

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

invert(a, out) → {Mat3}

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

mul()

Alias for mat3.multiply
Source:

multiply(a, b, out) → {Mat3}

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

normalFromMat4(a, out) → {Mat3}

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

rotate(a, rad, out) → {Mat3}

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

scale(a, v, out) → {Mat3}

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

str(mat) → {String}

Returns a string representation of a mat3
Parameters:
Name Type Description
mat Mat3 matrix to represent as a string
Returns:
string representation of the matrix
Type
String
Source:

translate(a, v, out) → {Mat3}

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

transpose(a, out) → {Mat3}

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