Create a Mat23 with the given components. Defaults to the identity matrix [1 0 0; 0 1 0].
Component at row 0, col 0.
Component at row 0, col 1.
Component at row 1, col 0.
Component at row 1, col 1.
Translation component along x.
Translation component along y.
Matrix component at row 0, col 0. The matrix layout is [a b tx; c d ty].
Matrix component at row 0, col 0. The matrix layout is [a b tx; c d ty].
Matrix component at row 0, col 1. The matrix layout is [a b tx; c d ty].
Matrix component at row 0, col 1. The matrix layout is [a b tx; c d ty].
Matrix component at row 1, col 0. The matrix layout is [a b tx; c d ty].
Matrix component at row 1, col 0. The matrix layout is [a b tx; c d ty].
Matrix component at row 1, col 1. The matrix layout is [a b tx; c d ty].
Matrix component at row 1, col 1. The matrix layout is [a b tx; c d ty].
The determinant of the linear 2×2 part (ad − bc).
Translation component along x. The matrix layout is [a b tx; c d ty].
Translation component along x. The matrix layout is [a b tx; c d ty].
Translation component along y. The matrix layout is [a b tx; c d ty].
Translation component along y. The matrix layout is [a b tx; c d ty].
Return a new Mat23 with the same components. Alias for copy().
A new Mat23 with the same components.
Check whether this Mat23 is component-wise equal to another, within an optional epsilon tolerance.
The Mat23 to compare against.
Maximum allowed difference per component (default 0).
true if all six components differ by at most epsilon.
Return true if the matrix is equiorthogonal (uniform scale, no shear).
true when the matrix has equal scale on both axes and no shear.
Adjust the matrix in-place to be equiorthogonal (uniform scale, no shear).
this for chaining.
Apply the inverse transformation to a Vec2. Throws if the matrix is singular.
The Vec2 to transform.
When true, the translation components (tx, ty) are ignored.
If true, the returned Vec2 is a weak (pooled) reference.
A new Vec2 with the inverse-transformed coordinates.
Return true if the matrix is orthogonal (unit-scale rotation, no shear).
true when the column vectors are orthonormal.
Adjust the matrix in-place to be orthogonal (normalise column vectors).
this for chaining.
Reset to the identity matrix in-place.
this for chaining.
Copy all components from another Mat23 into this one in-place.
The source matrix to copy from.
this for chaining.
Set all six components at once in-place.
Component at row 0, col 0.
Component at row 0, col 1.
Component at row 1, col 0.
Component at row 1, col 1.
Translation along x.
Translation along y.
this for chaining.
Return true if the matrix is singular (non-invertible) within the engine's epsilon threshold.
true when the matrix cannot be safely inverted.
String representation { a: … b: … c: … d: … tx: … ty: … }.
A human-readable string of the matrix components.
Transform a Vec2 by this matrix. If noTranslation is true, only the linear 2×2 part is applied.
The Vec2 to transform.
When true, the translation components (tx, ty) are ignored.
If true, the returned Vec2 is a weak (pooled) reference.
A new Vec2 with the transformed coordinates.
Static_StaticrotationCreate a pure rotation matrix for the given angle in radians.
Rotation angle in radians.
A new Mat23 representing the rotation.
StaticscaleCreate a pure scale matrix.
Scale factor along x.
Scale factor along y.
A new Mat23 representing the scale.
StatictranslationCreate a pure translation matrix.
Translation along x.
Translation along y.
A new Mat23 representing the translation.
2x3 affine transformation matrix [a b tx; c d ty].
Converted from nape-compiled.js lines 20507–21760.