public final class Point3i extends Tuple3i
We consider a point to be a tuple representing a single physical point in space.
Modifier and Type | Field and Description |
---|---|
static Point3i |
ORIGIN
A constant
Point3i where all dimensions are zero. |
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 . |
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)
Adds two tuples immutably.
|
static Point3i |
immutableAdd(ReadableTuple3i tuple1,
ReadableTuple3i tuple2,
ReadableTuple3i tuple3)
Adds three tuples immutably.
|
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.
|
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
compareTo, matchAllDimensions, matchAllDimensions
public Point3i()
public Point3i(int valueForAllDimensions)
valueForAllDimensions
- the value for each dimension.public Point3i(int x, int y, int z)
x
- the value for the X-dimension.y
- the value for the Y-dimension.z
- the value for the Z-dimension.public Point3i(ReadableTuple3i point)
ReadableTuple3i
.point
- to copy values from.public double distance(Point3i point)
point
- the other point to a measure a distance to.public int distanceSquared(Point3i point)
Point3i
.point
- the other point to a measure a distance to.public double distanceSquared(Point3d point)
Point3d
.point
- the other point to a measure a distance to.public int distanceMax(Point3i point)
point
- the point to consider distances to, across each axis.public Point3i duplicateChangeZ(int zValueToAssign)
ReadableTuple3i
zValueToAssign
- the value to assign in the Z-axis.public static Point3i immutableAdd(ReadableTuple3i tuple1, ReadableTuple3i tuple2)
tuple1
- the first tuple to add.tuple2
- the second tuple to add.public static Point3i immutableAdd(ReadableTuple3i tuple1, ReadableTuple3i tuple2, ReadableTuple3i tuple3)
tuple1
- the first tuple to add.tuple2
- the second tuple to add.tuple3
- the third tuple to add.public static Point3i immutableAdd(ReadableTuple3i tuple, int x, int y, int z)
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.public static Point3i immutableSubtract(ReadableTuple3i tuple, ReadableTuple3i toSubtract)
tuple
- the tuple to subtract from.toSubtract
- the tuple to subtract.public static Point3i immutableScale(ReadableTuple3i point, int factor)
factor
without changing any values in an existing point.
This is an immutable operation that produces a new point.
point
- the point whose component's will be scaled.factor
- the factor to scale by.public static Point3i elementwiseOperation(ReadableTuple3i tuple1, ReadableTuple3i tuple2, java.util.function.IntBinaryOperator operator)
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.operator
to the components of
each tuple.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.