JavaScripture
Contribute via GitHub Feedback

DOMPoint : DOMPointReadOnly

Represents a 3D point using homogeneous coordinates.

Constructors

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

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:

 

DOMPoint Methods

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

Returns a new DOMPoint that copies the coordinates from point.

Example:

Run

Results:

 

fromPoint(point : DOMPointReadOnly) : DOMPoint

Returns a new DOMPoint that copies the coordinates from point.

Example:

Run

Results: