Tuple3DReadOnly
Point3DBasics
public interface Point3DReadOnly extends Tuple3DReadOnly
A 3D point represents the 3D coordinates of a location in space.
Although a point and vector hold onto the same type of information, the distinction is made between them as they represent different geometry objects and are typically not handled the same way:
Modifier and Type | Method | Description |
---|---|---|
default double |
distance(Point3DReadOnly other) |
Calculates and returns the distance between this point and
other . |
default double |
distanceFromOrigin() |
Calculates and returns the distance between this point and the origin (0, 0, 0).
|
default double |
distanceFromOriginSquared() |
Calculates and returns the square of the distance between this point and the origin (0, 0, 0).
|
default double |
distanceSquared(Point3DReadOnly other) |
Calculates and returns the square of the distance between this point and
other . |
default double |
distanceXY(Point2DReadOnly point2DReadOnly) |
Calculates and returns the distance between this point and
point2DReadOnly in the
XY-plane. |
default double |
distanceXY(Point3DReadOnly other) |
Calculates and returns the distance between this point and
other in the XY-plane. |
default double |
distanceXYSquared(Point2DReadOnly point2DReadOnly) |
Calculates and returns the square of the distance between this point and
point2DReadOnly in the XY-plane. |
default double |
distanceXYSquared(Point3DReadOnly other) |
Calculates and returns the square of the distance between this point and
other in the
XY-plane. |
default boolean |
geometricallyEquals(Point3DReadOnly other,
double epsilon) |
Tests if
this and other represent the same point 3D to an epsilon . |
containsNaN, epsilonEquals, equals, get, get, get, get, get, get, get, getElement, getElement32, getX, getX32, getY, getY32, getZ, getZ32
default double distance(Point3DReadOnly other)
other
.other
- the other point used to measure the distance.default double distanceSquared(Point3DReadOnly other)
other
.
This method is usually preferred over distance(Point3DReadOnly)
when calculation
speed matters and knowledge of the actual distance does not, i.e. when comparing distances
between several pairs of points.
other
- the other point used to measure the square of the distance.default double distanceXY(Point3DReadOnly other)
other
in the XY-plane.
Effectively, this calculates the distance as follows:
dxy = √((this.x - other.x)2 + (this.y - other.y)2)
other
- the other point used to measure the distance.default double distanceXYSquared(Point3DReadOnly other)
other
in the
XY-plane.
Effectively, this calculates the distance squared as follows:
dxy2 = (this.x - other.x)2 + (this.y - other.y)2
This method is usually preferred over distanceXY(Point3DReadOnly)
when calculation
speed matters and knowledge of the actual distance does not, i.e. when comparing distances
between several pairs of points.
other
- the other point used to measure the square of the distance.default double distanceXY(Point2DReadOnly point2DReadOnly)
point2DReadOnly
in the
XY-plane.
Effectively, this calculates the distance as follows:
dxy = √((this.x - point2DReadOnly.x)2 + (this.y -
point2DReadOnly.y)2)
point2DReadOnly
- the other point used to measure the distance.default double distanceXYSquared(Point2DReadOnly point2DReadOnly)
point2DReadOnly
in the XY-plane.
Effectively, this calculates the distance squared as follows:
dxy2 = (this.x - point2DReadOnly.x)2 + (this.y -
point2DReadOnly.y)2
This method is usually preferred over distanceXY(Point2DReadOnly)
when calculation
speed matters and knowledge of the actual distance does not, i.e. when comparing distances
between several pairs of points.
point2DReadOnly
- the other point used to measure the square of the distance.default double distanceFromOrigin()
default double distanceFromOriginSquared()
This method is usually preferred over distanceFromOrigin()
when calculation speed
matters and knowledge of the actual distance does not, i.e. when comparing distances of
several points with respect to the origin.
default boolean geometricallyEquals(Point3DReadOnly 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.
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.