org.anchoranalysis.spatial.point

## Class Point3i

• ### Field Summary

Fields
Modifier and Type Field and Description
`static Point3i` `ORIGIN`
A constant `Point3i` where all dimensions are zero.
• ### Fields inherited from class Tuple3i

`x, y, z`
• ### Constructor Summary

Constructors
Constructor and Description
`Point3i()`
Creates the points with a 0 in each dimension.
`Point3i(int valueForAllDimensions)`
Create with an identical value in each dimension.
```Point3i(int x, int y, int z)```
Create with values for each dimension.
`Point3i(ReadableTuple3i point)`
Creates with the same values as an existing `ReadableTuple3i`.
• ### Method Summary

All Methods
Modifier and Type Method and Description
`protected boolean` `canEqual(Object other)`
`double` `distance(Point3i point)`
The Euclidean distance between this point and another.
`int` `distanceMax(Point3i point)`
The maximum distance across any individual axis to another point.
`double` `distanceSquared(Point3d point)`
The square of the Euclidean distance between this point and another `Point3d`.
`int` `distanceSquared(Point3i point)`
The square of the Euclidean distance between this point and another `Point3i`.
`Point3i` `duplicateChangeZ(int zValueToAssign)`
Creates a copy of the current tuple, but with a different Z-component value.
`static Point3i` ```elementwiseOperation(ReadableTuple3i tuple1, ReadableTuple3i tuple2, java.util.function.IntBinaryOperator operator)```
Creates a new point by applying a pairwise operation to each dimension's values for two tuples.
`boolean` `equals(Object o)`
`int` `hashCode()`
`static Point3i` ```immutableAdd(ReadableTuple3i tuple, int x, int y, int z)```
Adds values to a tuple immutably.
`static Point3i` ```immutableAdd(ReadableTuple3i tuple1, ReadableTuple3i tuple2)```
`static Point3i` ```immutableAdd(ReadableTuple3i tuple1, ReadableTuple3i tuple2, ReadableTuple3i tuple3)```
`static Point3i` ```immutableScale(ReadableTuple3i point, int factor)```
Multiplies each component by `factor` without changing any values in an existing point.
`static Point3i` ```immutableSubtract(ReadableTuple3i tuple, ReadableTuple3i toSubtract)```
Subtracts two tuples immutably.
• ### Methods inherited from class Tuple3i

`add, decrementX, decrementX, decrementY, decrementY, decrementZ, decrementZ, divideBy, incrementX, incrementX, incrementY, incrementY, incrementZ, incrementZ, max, max, min, scale, scale, scaleX, scaleXY, scaleY, setX, setY, setZ, subtract, subtract, toString, valueByDimension, valueByDimension, x, y, z`
• ### Methods inherited from class Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`
• ### Methods inherited from interface ReadableTuple3i

`compareTo, matchAllDimensions, matchAllDimensions`
• ### Field Detail

• #### ORIGIN

`public static final Point3i ORIGIN`
A constant `Point3i` where all dimensions are zero.
• ### Constructor Detail

• #### Point3i

`public Point3i()`
Creates the points with a 0 in each dimension.
• #### Point3i

`public Point3i(int valueForAllDimensions)`
Create with an identical value in each dimension.
Parameters:
`valueForAllDimensions` - the value for each dimension.
• #### Point3i

```public Point3i(int x,
int y,
int z)```
Create with values for each dimension.
Parameters:
`x` - the value for the X-dimension.
`y` - the value for the Y-dimension.
`z` - the value for the Z-dimension.
• #### Point3i

`public Point3i(ReadableTuple3i point)`
Creates with the same values as an existing `ReadableTuple3i`.
Parameters:
`point` - to copy values from.
• ### Method Detail

• #### distance

`public double distance(Point3i point)`
The Euclidean distance between this point and another.
Parameters:
`point` - the other point to a measure a distance to.
Returns:
the distance.
• #### distanceSquared

`public int distanceSquared(Point3i point)`
The square of the Euclidean distance between this point and another `Point3i`.
Parameters:
`point` - the other point to a measure a distance to.
Returns:
the distance squared.
• #### distanceSquared

`public double distanceSquared(Point3d point)`
The square of the Euclidean distance between this point and another `Point3d`.
Parameters:
`point` - the other point to a measure a distance to.
Returns:
the distance squared.
• #### distanceMax

`public int distanceMax(Point3i point)`
The maximum distance across any individual axis to another point.
Parameters:
`point` - the point to consider distances to, across each axis.
Returns:
the maximal distance along any one particular axis.
• #### duplicateChangeZ

`public Point3i duplicateChangeZ(int zValueToAssign)`
Description copied from interface: `ReadableTuple3i`
Creates a copy of the current tuple, but with a different Z-component value.
Parameters:
`zValueToAssign` - the value to assign in the Z-axis.
Returns:
a copy of the current object with changed Z-component value.

```public static Point3i immutableAdd(ReadableTuple3i tuple1,
Parameters:
`tuple1` - the first tuple to add.
`tuple2` - the second tuple to add.
Returns:
a newly created point, where each dimension is the sum of the corresponding dimensions in the points.

```public static Point3i immutableAdd(ReadableTuple3i tuple1,
Parameters:
`tuple1` - the first tuple to add.
`tuple2` - the second tuple to add.
`tuple3` - the third tuple to add.
Returns:
a newly created point, where each dimension is the sum of the corresponding dimensions in the points.

```public static Point3i immutableAdd(ReadableTuple3i tuple,
int x,
int y,
int z)```
Adds values to a tuple immutably.
Parameters:
`tuple` - the tuple to add.
`x` - the value to add to the X-component.
`y` - the value to add to the Y-component.
`z` - the value to add to the Z-component.
Returns:
a newly created point, where each dimension is the sum of the corresponding dimensions in the points.
• #### immutableSubtract

```public static Point3i immutableSubtract(ReadableTuple3i tuple,
Subtracts two tuples immutably.
Parameters:
`tuple` - the tuple to subtract from.
`toSubtract` - the tuple to subtract.
Returns:
a newly created point, where each dimension is the subtraction of the corresponding dimensions in the points.
• #### immutableScale

```public static Point3i immutableScale(ReadableTuple3i point,
int factor)```
Multiplies each component by `factor` without changing any values in an existing point.

This is an immutable operation that produces a new point.

Parameters:
`point` - the point whose component's will be scaled.
`factor` - the factor to scale by.
Returns:
a newly created point with scaled values.
• #### elementwiseOperation

```public static Point3i elementwiseOperation(ReadableTuple3i tuple1,
java.util.function.IntBinaryOperator operator)```
Creates a new point by applying a pairwise operation to each dimension's values for two tuples.
Parameters:
`tuple1` - the first tuple.
`tuple2` - the second tuple.
`operator` - the operator to apply to each dimension of the tuples to produce the corresponding dimension in the returned tuple.
Returns:
a newly-created point arising from applying `operator` to the components of each tuple.
• #### equals

`public boolean equals(Object o)`
Overrides:
`equals` in class `Tuple3i`
• #### canEqual

`protected boolean canEqual(Object other)`
Overrides:
`canEqual` in class `Tuple3i`
• #### hashCode

`public int hashCode()`
Overrides:
`hashCode` in class `Tuple3i`