You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The DOMMatrix interface represents a 4x4 homogeneous matrix for 2D and 3D transformations. It is the mutable variant of DOMMatrixReadOnly. DOMMatrix is used by CSS transforms, canvas transformations, and the WebXR API.
Constructor
// From existing referencepublicDOMMatrix(SpawnJSObjectReference _ref)// From CSS transform stringpublicDOMMatrix(string transformList)// e.g., "translate(50px, 50px) rotate(45deg)"// From matrix values (6 values for 2D, 16 for 3D)publicDOMMatrix(double[] values)
Properties - 2D Matrix (a-f)
Property
Type
Description
A
double
Scale X (same as M11).
B
double
Skew Y (same as M12).
C
double
Skew X (same as M21).
D
double
Scale Y (same as M22).
E
double
Translate X (same as M41).
F
double
Translate Y (same as M42).
Properties - 4x4 Matrix
Property
Type
Description
M11 through M44
double
The 16 values of the 4x4 matrix (row-major).
Is2D
bool
Whether this is a 2D matrix.
IsIdentity
bool
Whether this is the identity matrix.
Methods
Method
Return Type
Description
Multiply(DOMMatrix other)
DOMMatrix
Post-multiply by another matrix. Modifies this matrix.
MultiplySelf(DOMMatrix other)
DOMMatrix
Same as Multiply - post-multiply in place.
PreMultiplySelf(DOMMatrix other)
DOMMatrix
Pre-multiply by another matrix in place.
Translate(double tx, double ty)
DOMMatrix
Apply a translation.
Translate(double tx, double ty, double tz)
DOMMatrix
Apply a 3D translation.
TranslateSelf(double tx, double ty)
DOMMatrix
Translate in place.
Scale(double scaleX, double scaleY)
DOMMatrix
Apply a scale.
ScaleSelf(double scaleX, double scaleY)
DOMMatrix
Scale in place.
Scale3dSelf(double scale)
DOMMatrix
Uniform 3D scale in place.
Rotate(double rotX, double rotY, double rotZ)
DOMMatrix
Apply a rotation (degrees).
RotateSelf(double rotX, double rotY, double rotZ)
DOMMatrix
Rotate in place.
RotateAxisAngleSelf(double x, double y, double z, double angle)