A DOMPoint object represents a 2D or 3D point in a coordinate system; it includes values for the coordinates in up to three dimensions, as well as an optional perspective value. DOMPoint is based on DOMPointReadOnly but allows its properties' values to be changed.

In general, a positive x component represents a position to the right of the origin, a positive y component is downward from the origin, and a positive z component extends outward from the screen (in other words, toward the user).

DOMPointReadOnly DOMPoint



Creates and returns a new DOMPoint object given the values of zero or more of its coordinate components and optionally the w perspective value. You can also use an existing DOMPoint or DOMPointReadOnly or an object to create a new point by calling the DOMPoint.fromPoint() static method.

Instance properties

DOMPoint may also inherit properties from its parent, DOMPointReadOnly.


The x coordinate of the DOMPoint.


The y coordinate of the DOMPoint.


The z coordinate of the DOMPoint.


The perspective value of the DOMPoint.

Instance methods

DOMPoint inherits instance methods from its parent, DOMPointReadOnly.

Static methods

DOMPoint may also inherit static methods from its parent, DOMPointReadOnly.


Creates a new mutable DOMPoint object given an existing point (or an object containing matching properties), which provides the values for its properties.


In the WebXR Device API, DOMPointReadOnly values represent positions and orientations. In the following snippet, the pose of the XR device (such as a VR headset or phone with AR capabilities) can be retrieved by calling using XRFrame.getViewerPose() during an XRSession animation frame, then accessing the resulting XRPose's transform property, which contains two DOMPointReadOnly attributes: position as a vector and orientation as a quaternion.

function onXRFrame(time, xrFrame) {
  let viewerPose = xrFrame.getViewerPose(xrReferenceSpace);

  if (viewerPose) {
    let position = viewerPose.transform.position;
    let orientation = viewerPose.transform.orientation;

      `XR Viewer Position: {x: ${roundToTwo(position.x)}, y: ${roundToTwo(
      )}, z: ${roundToTwo(position.z)}`,

      `XR Viewer Orientation: {x: ${roundToTwo(orientation.x)}, y: ${roundToTwo(
      )}, z: ${roundToTwo(orientation.z)}, w: ${roundToTwo(orientation.w)}`,


Geometry Interfaces Module Level 1
# DOMPoint

Browser compatibility

BCD tables only load in the browser

See also