Point3D

Immutable 3D point.

Constructor

new Point3D(x, y, z)

Parameters:
NameTypeDescription
xnumber

The X coordinate for the point.

ynumber

The Y coordinate for the point.

znumber

The Z coordinate for the point.

Classes

Point3D

Methods

equals(rhs) → {boolean}

Check for Point3D equality.

Parameters:
NameTypeDescription
rhsPoint3D

The other point to compare to.

Returns:

True if both points are equal.

Type: 
boolean

getDistance(point3D) → {number}

Get the distance to another Point3D.

Parameters:
NameTypeDescription
point3DPoint3D

The input point.

Returns:

Ths distance to the input point.

Type: 
number

getX() → {number}

Get the X position of the point.

Returns:

The X position of the point.

Type: 
number

getY() → {number}

Get the Y position of the point.

Returns:

The Y position of the point.

Type: 
number

getZ() → {number}

Get the Z position of the point.

Returns:

The Z position of the point.

Type: 
number

isSimilar(rhs, tol) → {boolean}

Check for Point3D similarity.

Parameters:
NameTypeDescription
rhsPoint3D

The other point to compare to.

tolnumber

Optional comparison tolerance, default to Number.EPSILON.

Returns:

True if both points are equal.

Type: 
boolean

minus(point3D) → {Vector3D}

Get the difference to another Point3D.

Parameters:
NameTypeDescription
point3DPoint3D

The input point.

Returns:

The 3D vector from the input point to this one.

Type: 
Vector3D

toString() → {string}

Get a string representation of the Point3D.

Returns:

The point as a string.

Type: 
string