/* 2D */
const point2D = new DOMPointReadOnly(50, 50);
/* 3D */
const point3D = new DOMPointReadOnly(50, 50, 25);
/* 3D with perspective */
const point3DPerspective = new DOMPointReadOnly(100, 100, 100, 1.0);DOMPointReadOnly / notebook
DOMPointReadOnly
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const point = DOMPointReadOnly.fromPoint({ x: 100, y: 100, z: 50, w: 1.0 });