// Initialize a 2D matrix
const matrix = new DOMMatrix(); // create a matrix
console.log(matrix.is2D); // output: true
// Transform in a 2D space
console.log(matrix.rotate(30).is2D); // output: true
// Apply a 3D transform
console.log(matrix.rotate(10, 20, 1).is2D); // output: falseDOMMatrixReadOnly: is2D property / notebook
DOMMatrixReadOnly: is2D property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.