dwv.math. Point

new Point(values)

Immutable point. Warning: the input array is NOT cloned, modifying it will modify the index values.

Parameters:
NameTypeDescription
valuesArray

The point values.

Methods

add(rhs) → {dwv.math.Point}

Add another point to this one.

Parameters:
NameTypeDescription
rhsdwv.math.Point

The point to add.

Returns:

The point representing the sum of both points.

Type: 
dwv.math.Point

canCompare(rhs) → {boolean}

Check if the input point can be compared to this one.

Parameters:
NameTypeDescription
rhsdwv.math.Point

The point to compare to.

Returns:

True if both points are comparable.

Type: 
boolean

compare(rhs) → {Array}

Compare points and return different dimensions.

Parameters:
NameTypeDescription
rhsdwv.math.Point

The point to compare to.

Returns:

The list of different dimensions.

Type: 
Array

equals(rhs) → {boolean}

Check for Point equality.

Parameters:
NameTypeDescription
rhsdwv.math.Point

The point to compare to.

Returns:

True if both points are equal.

Type: 
boolean

get(i) → {number}

Get the index value at the given array index.

Parameters:
NameTypeDescription
inumber

The index to get.

Returns:

The value.

Type: 
number

get3D() → {dwv.math.Point3D}

Get the 3D part of this point.

Returns:

The Point3D.

Type: 
dwv.math.Point3D

getValues() → {Array}

Get the values of this index.

Returns:

The array of values.

Type: 
Array

length() → {number}

Get the length of the index.

Returns:

The length.

Type: 
number

mergeWith3D(rhs) → {dwv.math.Point}

Merge this point with a Point3D to create a new point.

Parameters:
NameTypeDescription
rhsdwv.math.Point3D

The Point3D to merge with.

Returns:

The merge result.

Type: 
dwv.math.Point

toString() → {string}

Get a string representation of the Index.

Returns:

The Index as a string.

Type: 
string