Creates a new MutableMatrix22 instance.
Float32Array containing matrix values in column-major order
Gets the class name for debugging purposes.
The class name "MutableMatrix22"
Indicates whether this matrix is an identity matrix class.
This property should be overridden in derived classes that represent identity matrices to return true.
False for the base AbstractMatrix class
Gets the value at position (0,0) of the matrix.
The value at position (0,0)
Sets the value at position (0,0) of the matrix.
The value to set
Gets the value at position (0,1) of the matrix.
The value at position (0,1)
Sets the value at position (0,1) of the matrix.
The value to set
Gets the value at position (1,0) of the matrix.
The value at position (1,0)
Sets the value at position (1,0) of the matrix.
The value to set
Gets the value at position (1,1) of the matrix.
The value at position (1,1)
Sets the value at position (1,1) of the matrix.
The value to set
Static
compositionGets the composition type for this matrix.
The CompositionType.Mat2 enum value
Creates a deep copy of this matrix.
A new MutableMatrix22 instance with the same values
Copies the 2x2 portion of another matrix into this matrix. Works with Matrix22, Matrix33, or Matrix44 sources.
This matrix instance for method chaining
Extracts the scale factors from this transformation matrix and stores them in the output vector. This method avoids creating a new vector instance for better performance.
The mutable vector to store the scale factors
The output vector containing the scale factors
Sets this matrix to an identity matrix.
This matrix instance for method chaining
Inverts this matrix in place.
This matrix instance for method chaining
Checks if this matrix is approximately equal to another matrix within a tolerance.
The matrix to compare with
The tolerance for comparison (default: Number.EPSILON)
True if all corresponding elements are within the tolerance
Checks if this matrix is exactly equal to another matrix. Uses strict equality comparison for all elements.
The matrix to compare with
True if all corresponding elements are exactly equal
Checks if the matrix's internal storage shares the same ArrayBuffer as the provided one.
This method is useful for determining if two matrices share the same underlying memory, which can be important for performance optimizations and avoiding unnecessary data copying.
The ArrayBuffer to compare against
True if the internal storage uses the same ArrayBuffer, false otherwise
Multiplies this matrix by another matrix from the right side (this * mat).
The matrix to multiply with
This matrix instance for method chaining
Multiplies this matrix by another matrix from the left side (mat * this).
The matrix to multiply with from the left
This matrix instance for method chaining
Multiplies this matrix by a scale transformation in place.
Vector2 containing the scale factors for x and y axes
This matrix instance for method chaining
Multiplies this matrix by a 2D vector and stores the result in the output vector. This method avoids creating a new vector instance for better performance.
The 2D vector to multiply
The mutable vector to store the result
The output vector containing the transformed vector
Sets this matrix to a rotation matrix for the given angle.
The rotation angle in radians
This matrix instance for method chaining
Sets this matrix to a scale matrix from a 2D vector.
Vector2 containing the scale factors for x and y axes
This matrix instance for method chaining
Sets the value at the specified row and column position.
The row index (0-1)
The column index (0-1)
The value to set
This matrix instance for method chaining
Sets all matrix components directly.
Value for position (0,0)
Value for position (0,1)
Value for position (1,0)
Value for position (1,1)
This matrix instance for method chaining
Transposes this matrix in place (swaps rows and columns).
This matrix instance for method chaining
Gets the matrix element at the specified flat index.
This provides direct access to the underlying Float32Array storage using a single index rather than row/column coordinates.
The zero-based flat index into the matrix storage
The matrix element value at the specified index
Sets this matrix to a zero matrix (all elements are 0).
This matrix instance for method chaining
Static
dummyCreates a dummy matrix for placeholder purposes.
A new MutableMatrix22 dummy instance
Static
fromCreates a new matrix from values provided in column-major order. This matches the internal storage format used by WebGL.
Value for position (0,0)
Value for position (1,0)
Value for position (0,1)
Value for position (1,1)
A new MutableMatrix22 instance
Static
fromCreates a new matrix from values provided in row-major order. This is more intuitive for manual input as values are specified in the same order they appear visually in the matrix.
Value for position (0,0)
Value for position (0,1)
Value for position (1,0)
Value for position (1,1)
A new MutableMatrix22 instance
Static
fromCreates a new matrix from a 4-element array in column-major order.
Array4 containing matrix data in column-major order
A new MutableMatrix22 instance with copied data
Static
fromCreates a new matrix from a 4-element array in row-major order.
Array4 containing matrix data in row-major order
A new MutableMatrix22 instance with converted data
Static
fromCreates a new matrix from an array in column-major order.
Array containing matrix data in column-major order
A new MutableMatrix22 instance with copied data
Static
fromCreates a new matrix from an array in row-major order.
Array containing matrix data in row-major order
A new MutableMatrix22 instance with converted data
Static
fromCreates a new matrix by copying from a Float32Array in column-major order.
Float32Array containing matrix data in column-major order
A new MutableMatrix22 instance with copied data
Static
fromCreates a new matrix by copying from a Float32Array in row-major order.
Float32Array containing matrix data in row-major order
A new MutableMatrix22 instance with converted data
Static
fromCreates a new matrix by copying from another Matrix22 instance.
The source Matrix22 to copy from
A new MutableMatrix22 instance with copied data
Static
fromCreates a new matrix using the provided Float32Array directly (no copy). The array is expected to be in column-major order.
Float32Array containing matrix data in column-major order
A new MutableMatrix22 instance sharing the provided array
Static
identityCreates a new 2x2 identity matrix.
A new MutableMatrix22 identity matrix
Static
invertCreates a new matrix that is the inverse of the input matrix.
The matrix to invert
A new MutableMatrix22 containing the inverted matrix
Static
invertCalculates the inverse of the given matrix and stores the result in the output matrix. This method avoids creating a new matrix instance for better performance.
The matrix to invert
The mutable matrix to store the result
The output matrix containing the inverse
Static
multiplyMultiplies two matrices and returns a new matrix with the result.
A new MutableMatrix22 containing the multiplication result
Static
multiplyMultiplies two matrices and stores the result in the output matrix. This method avoids creating a new matrix instance for better performance.
Note: The parameter types suggest Matrix33, but this appears to be a bug as this should operate on Matrix22 instances.
The left matrix operand
The right matrix operand
The mutable matrix to store the result
The output matrix containing the product
Static
rotateCreates a new rotation matrix for the given angle.
The rotation angle in radians
A new MutableMatrix22 representing the rotation transformation
Static
scaleCreates a new scale matrix from a 2D vector.
Vector2 containing the scale factors for x and y axes
A new MutableMatrix22 representing the scale transformation
Static
transposeCreates a new matrix that is the transpose of the input matrix.
The matrix to transpose
A new MutableMatrix22 containing the transposed matrix
Static
zeroCreates a new zero matrix where all elements are 0.
A new MutableMatrix22 instance with all zero values
A mutable 2x2 matrix class that extends Matrix22 and provides modification capabilities. This class allows in-place operations for matrix transformations, making it suitable for performance-critical applications where object creation overhead should be minimized.
The matrix is stored in column-major order as a Float32Array, compatible with WebGL. Matrix layout:
Example