files/en-us/web/api/dommatrixreadonly/index.md
{{APIRef("Geometry Interfaces")}}{{AvailableInWorkers}}
The DOMMatrixReadOnly interface represents a read-only 4×4 matrix, suitable for 2D and 3D operations. The {{domxref("DOMMatrix")}} interface — which is based upon DOMMatrixReadOnly—adds mutability, allowing you to alter the matrix after creating it.
This interface should be available inside web workers, though some implementations doesn't allow it yet.
DOMMatrixReadOnly object.This interface doesn't inherit any properties.
true if the matrix was initialized as a 2D matrix. If false, the matrix is 3D.true if the matrix is an identity matrix.m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44
m11 through m14 are the first column, m21 through m24 are the second column, and so forth.a, b, c, d, e, f
: Double-precision floating-point values representing the components of a 4×4 matrix which are required in order to perform 2D rotations and translations. These are aliases for specific components of a 4×4 matrix, as shown below.
| 2D | 3D equivalent |
|---|---|
a | m11 |
b | m12 |
c | m21 |
d | m22 |
e | m41 |
f | m42 |
This interface doesn't inherit any methods. None of the following methods alter the original matrix.
DOMMatrix(-1, 0, 0, 1, 0, 0). The original matrix is not modified.DOMMatrix(1, 0, 0, -1, 0, 0). The original matrix is not modified.(1, 0). The original matrix is not modified.1 and the Y axis has no default scaling value. The default origin is (0, 0, 0). The original matrix is not modified.(0, 0, 0). The original matrix is not modified.1, but the scaling factor for X must be specified. The default origin is (0, 0, 0). The original matrix is not changed.DOMMatrixReadOnly object.(0, 0, 0). The original matrix is not changed.DOMMatrixReadOnly object given a {{jsxref("Float32Array")}} of 6 or 16 single-precision (32-bit) floating-point values.DOMMatrixReadOnly object given a {{jsxref("Float64Array")}} of 6 or 16 double-precision (64-bit) floating-point values.DOMMatrixReadOnly object given an existing matrix or an object which provides the values for its properties.{{Specifications}}
{{Compat}}