Clearable, EpsilonComparable<Point3D>, GeometricallyComparable<Point3D>, GeometryObject<Point3D>, Settable<Point3D>, Transformable, Point3DBasics, Point3DReadOnly, Tuple3DBasics, Tuple3DReadOnlypublic class Point3D extends java.lang.Object implements Point3DBasics, GeometryObject<Point3D>
This version of 3D point uses double precision fields to save the value of each component. It is meant for garbage free usage.
| Constructor | Description |
|---|---|
Point3D() |
Creates a new point and initializes it coordinates to zero.
|
Point3D(double[] pointArray) |
Creates a new point and initializes its component
x, y, z in order
from the given array. |
Point3D(double x,
double y,
double z) |
Creates a new point and initializes it with the given coordinates.
|
Point3D(Tuple2DReadOnly tuple2DReadOnly) |
Creates a new point and initializes its x and y components to
tuple2DReadOnly. |
Point3D(Tuple3DReadOnly other) |
Creates a new point and initializes it to
other. |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
epsilonEquals(Point3D other,
double epsilon) |
Tests on a per component basis if this point is equal to the given
other to an
epsilon. |
boolean |
equals(java.lang.Object object) |
Tests if the given
object's class is the same as this, in which case the method
returns Tuple3DReadOnly.equals(Tuple3DReadOnly), it returns false otherwise. |
boolean |
geometricallyEquals(Point3D other,
double epsilon) |
Tests if
this and other represent the same point 3D to an epsilon. |
double |
getX() |
Returns the value of the x-coordinate of this point.
|
double |
getY() |
Returns the value of the y-coordinate of this point.
|
double |
getZ() |
Returns the value of the z-coordinate of this point.
|
int |
hashCode() |
Calculates and returns a hash code value from the value of each component of this point 3D.
|
void |
set(Point3D other) |
Sets this point to
other. |
void |
setX(double x) |
Sets the x-coordinate of this point.
|
void |
setY(double y) |
Sets the y-coordinate of this point.
|
void |
setZ(double z) |
Sets the z-coordinate of this point.
|
java.lang.String |
toString() |
Provides a
String representation of this point 3D as follows: (x, y, z). |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitapplyInverseTransform, applyTransformdistance, distanceFromOrigin, distanceFromOriginSquared, distanceSquared, distanceXY, distanceXY, distanceXYSquared, distanceXYSquared, geometricallyEqualsabsolute, add, add, add, addX, addY, addZ, clipToMax, clipToMin, clipToMinMax, containsNaN, interpolate, interpolate, negate, scale, scale, scaleAdd, scaleAdd, scaleSub, scaleSub, set, set, set, set, set, set, set, set, set, set, set, setAndAbsolute, setAndClipToMax, setAndClipToMin, setAndClipToMinMax, setAndNegate, setAndScale, setElement, setToNaN, setToZero, sub, sub, sub, subX, subY, subZepsilonEquals, equals, get, get, get, get, get, get, get, getElement, getElement32, getX32, getY32, getZ32public Point3D()
public Point3D(double x,
double y,
double z)
x - the x-coordinate.y - the y-coordinate.z - the z-coordinate.public Point3D(double[] pointArray)
x, y, z in order
from the given array.pointArray - the array containing this point's coordinates. Not modified.public Point3D(Tuple2DReadOnly tuple2DReadOnly)
tuple2DReadOnly.tuple2DReadOnly - the tuple to copy the coordinates from. Not modified.public Point3D(Tuple3DReadOnly other)
other.other - the tuple to copy the coordinates from. Not modified.public void set(Point3D other)
other.public void setX(double x)
setX in interface Tuple3DBasicsx - the x-coordinate.public void setY(double y)
setY in interface Tuple3DBasicsy - the y-coordinate.public void setZ(double z)
setZ in interface Tuple3DBasicsz - the z-coordinate.public double getX()
getX in interface Tuple3DReadOnlypublic double getY()
getY in interface Tuple3DReadOnlypublic double getZ()
getZ in interface Tuple3DReadOnlypublic boolean equals(java.lang.Object object)
object's class is the same as this, in which case the method
returns Tuple3DReadOnly.equals(Tuple3DReadOnly), it returns false otherwise.equals in class java.lang.Objectobject - the object to compare against this. Not modified.true if object and this are exactly equal, false otherwise.public boolean epsilonEquals(Point3D other, double epsilon)
other to an
epsilon.epsilonEquals in interface EpsilonComparable<Point3D>other - the other point to compare against this. Not modified.epsilon - the tolerance to use when comparing each component.true if the two tuples are equal, false otherwise.public boolean geometricallyEquals(Point3D other, double epsilon)
this and other represent the same point 3D to an epsilon.
Two points are considered geometrically equal if they are at a distance of less than or equal
to epsilon.
Note that this.geometricallyEquals(other, epsilon) == true does not necessarily imply
this.epsilonEquals(other, epsilon) and vice versa.
geometricallyEquals in interface GeometricallyComparable<Point3D>other - the other point 3D to compare against this. Not modified.epsilon - the maximum distance that the two points can be spaced and still considered
equal.true if the two points represent the same geometry, false otherwise.public java.lang.String toString()
String representation of this point 3D as follows: (x, y, z).toString in class java.lang.ObjectString representing this point 3D.public int hashCode()
hashCode in class java.lang.Object