JavaScripture
Contribute via GitHub Feedback

DOMPointReadOnly : Object

Represents a 3D point using homogeneous coordinates (x, y, z, and w). See also DOMPoint.

Constructors

new DOMPointReadOnly([x = 0 : Number, [y = 0 : Number, [z = 0 : Number, [w = 1 : Number]]]]) : DOMPointReadOnly

Example:

Run

Results:

 

Instance Properties

w : Number  

The w coordinate of the point. Typically set to 1. See homogeneous coordinates for more details.

Example:

Run

Results:

 

x : Number  

The x coordinate of the point.

Example:

Run

Results:

 

y : Number  

The y coordinate of the point.

Example:

Run

Results:

 

z : Number  

The z coordinate of the point.

Example:

Run

Results:

 

DOMPointReadOnly Methods

fromPoint 2 variants
fromPoint([point : Object]) : DOMPointReadOnly
point : {
x :NumberDefault = 0
y :NumberDefault = 0
z :NumberDefault = 0
w :NumberDefault = 1
}

Returns a new DOMPointReadOnly that copies the coordinates from point.

Example:

Run

Results:

 

fromPoint([point : DOMPointReadOnly]) : DOMPointReadOnly

Returns a new DOMPointReadOnly that copies the coordinates from point.

Example:

Run

Results:

 

matrixTransform([matrix : DOMMatrix]) : DOMPoint

Example:

Run

Results: