## 在此页

``` DOMPointReadOnly ``` interface specifies the coordinate and perspective fields used by ``` DOMPoint ``` to define a 2D or 3D point in a coordinate system.

There are two ways to create a new ``` DOMPointReadOnly ``` instance. First, you can use its constructor, passing in the values of the parameters for each dimension and, optionally, the perspective:

```/* 2D */
const point = new DOMPointReadOnly(50, 50);
/* 3D */
const point = new DOMPointReadOnly(50, 50, 25);
/* 3D with perspective */
const point = new DOMPointReadOnly(100, 100, 100, 1.0);
```

The other option is to use the static ``` DOMPointReadOnly.fromPoint() ``` method:

```const point = DOMPointReadOnly.fromPoint({x: 100, y: 100, z: 50; w: 1.0});
```

## 构造函数

``` DOMPointReadOnly() ```

## 特性

``` DOMPointReadOnly.x ``` 只读
The point's horizontal coordinate, ``` x ``` .
``` DOMPointReadOnly.y ``` 只读
The point's vertical coordinate, ``` y ``` .
``` DOMPointReadOnly.z ``` 只读
The point's depth coordinate, ``` z ``` .
``` DOMPointReadOnly.w ``` 只读
The point's perspective value, ``` w ``` .

## 静态方法

``` DOMPointReadOnly.fromPoint() ```
A static method that creates a new ``` DOMPointReadOnly ``` object given the coordinates provided in the specified ``` DOMPointInit ``` 对象。

## 方法

``` matrixTransform() ```
Applies a matrix transform specified as a ``` DOMMatrixInit ``` object to the ``` DOMPointReadOnly ``` 对象。
``` toJSON() ```
Returns a JSON representation of the ``` DOMPointReadOnly ``` 对象。

## 规范

Geometry Interfaces Module Level 1
The definition of 'DOMPoint' in that specification.

## 浏览器兼容性

 Desktop Mobile Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Chrome 61 Edge 79 Firefox 31 IE No Opera 48 Safari 10.1 WebView Android 61 Chrome Android 61 Firefox Android 31 Opera Android 45 Safari iOS 10.3 Samsung Internet Android 8.0 Chrome 61 Edge 79 Firefox 31 IE No Opera 48 Safari 10.1 WebView Android 61 Chrome Android 61 Firefox Android 31 Opera Android 45 Safari iOS 10.3 Samsung Internet Android 8.0 Chrome 61 Edge 79 Firefox 31 IE No Opera 48 Safari 10.1 WebView Android 61 Chrome Android 61 Firefox Android 31 Opera Android 45 Safari iOS 10.3 Samsung Internet Android 8.0 Chrome 61 Edge 79 Firefox 31 IE No Opera 48 Safari 10.1 WebView Android 61 Chrome Android 61 Firefox Android 31 Opera Android 45 Safari iOS 10.3 Samsung Internet Android 8.0 Chrome 61 Edge 79 Firefox 62 IE No Opera 48 Safari 10.1 WebView Android 61 Chrome Android 61 Firefox Android 62 Opera Android 45 Safari iOS 10.3 Samsung Internet Android 8.0 Chrome 61 Edge 79 Firefox 31 IE No Opera 48 Safari 10.1 WebView Android 61 Chrome Android 61 Firefox Android 31 Opera Android 45 Safari iOS 10.3 Samsung Internet Android 8.0 Chrome 61 Edge 79 Firefox 69 IE No Opera 48 Safari 10.1 WebView Android 61 Chrome Android 61 Firefox Android No Opera Android 45 Safari iOS 10.3 Samsung Internet Android 8.0 Chrome 61 Edge 79 Firefox 31 IE No Opera 48 Safari 10.1 WebView Android 61 Chrome Android 61 Firefox Android 31 Opera Android 45 Safari iOS 10.3 Samsung Internet Android 8.0 Chrome 61 Edge 79 Firefox 31 IE No Opera 48 Safari 10.1 WebView Android 61 Chrome Android 61 Firefox Android 31 Opera Android 45 Safari iOS 10.3 Samsung Internet Android 8.0 Chrome 61 Edge 79 Firefox 31 IE No Opera 48 Safari 10.1 WebView Android 61 Chrome Android 61 Firefox Android 31 Opera Android 45 Safari iOS 10.3 Samsung Internet Android 8.0

## 另请参阅

1. ``` DOMPointReadOnly ```
2. 构造函数
3. 特性
4. 方法
5. Related pages for Geometry Interfaces