Point

dwv.math. Point

new Point(values)

Source:

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

Parameters:
Name Type Description
values Array

The point values.

Methods

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

Source:

Add another point to this one.

Parameters:
Name Type Description
rhs dwv.math.Point

The point to add.

Returns:

The point representing the sum of both points.

Type
dwv.math.Point

canCompare(rhs) → {boolean}

Source:

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

Parameters:
Name Type Description
rhs dwv.math.Point

The point to compare to.

Returns:

True if both points are comparable.

Type
boolean

compare(rhs) → {Array}

Source:

Compare points and return different dimensions.

Parameters:
Name Type Description
rhs dwv.math.Point

The point to compare to.

Returns:

The list of different dimensions.

Type
Array

equals(rhs) → {boolean}

Source:

Check for Point equality.

Parameters:
Name Type Description
rhs dwv.math.Point

The point to compare to.

Returns:

True if both points are equal.

Type
boolean

get(i) → {number}

Source:

Get the index value at the given array index.

Parameters:
Name Type Description
i number

The index to get.

Returns:

The value.

Type
number

get3D() → {dwv.math.Point3D}

Source:

Get the 3D part of this point.

Returns:

The Point3D.

Type
dwv.math.Point3D

getValues() → {Array}

Source:

Get the values of this index.

Returns:

The array of values.

Type
Array

length() → {number}

Source:

Get the length of the index.

Returns:

The length.

Type
number

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

Source:

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

Parameters:
Name Type Description
rhs dwv.math.Point3D

The Point3D to merge with.

Returns:

The merge result.

Type
dwv.math.Point

toString() → {string}

Source:

Get a string representation of the Index.

Returns:

The Index as a string.

Type
string