Top Description Fields Constructors Methods
javafx.geometry

public Class Point3D

extends Object
implements Interpolatable<Point3D>
Class Inheritance
All Implemented Interfaces
javafx.animation.Interpolatable
Imports
javafx.animation.Interpolatable, javafx.beans.NamedArg, java.util.Objects

A 3D geometric point that usually represents the x, y, z coordinates. It can also represent a relative magnitude vector's x, y, z magnitudes.
Since
JavaFX 2.0

Field Summary

Modifier and TypeField and Description
private int
hash

Cache the hash code to make computing hashes faster.

private final double
x

The x coordinate.

private final double
y

The y coordinate.

private final double
z

The z coordinate.

public static final Point3D
ZERO

Point or vector with all three coordinates set to 0.

Constructor Summary

AccessConstructor and Description
public
Point3D(double
The X coordinate of the Point3D
x
,
double
The Y coordinate of the Point3D
y
,
double
The Z coordinate of the Point3D
z
)

Creates a new instance of Point3D.

Method Summary

Modifier and TypeMethod and Description
public Point3D

Returns:

the point with added coordinates
add
(double
the X coordinate addition
x
,
double
the Y coordinate addition
y
,
double
the Z coordinate addition
z
)

Returns a point with the specified coordinates added to the coordinates of this point.

public Point3D

Returns:

the point with added coordinates
add
(Point3D
the point whose coordinates are to be added
point
)

Returns a point with the coordinates of the specified point added to the coordinates of this point.

public double

Returns:

the angle between the two vectors measured in degrees
angle
(double
the X magnitude of the other vector
x
,
double
the Y magnitude of the other vector
y
,
double
the Z magnitude of the other vector
z
)

Computes the angle (in degrees) between the vector represented by this point and the specified vector.

public double

Returns:

the angle between the two vectors measured in degrees, NaN if any of the two vectors is a zero vector
angle
(Point3D
the other vector
point
)

Computes the angle (in degrees) between the vector represented by this point and the vector represented by the specified point.

public double

Returns:

angle between the vectors (this, p1) and (this, p2) measured in degrees, NaN if the three points are not different from one another
angle
(Point3D
one point
p1
,
Point3D
other point
p2
)

Computes the angle (in degrees) between the three points with this point as a vertex.

public Point3D

Returns:

the cross product of the two vectors
crossProduct
(double
the X magnitude of the other vector
x
,
double
the Y magnitude of the other vector
y
,
double
the Z magnitude of the other vector
z
)

Computes cross product of the vector represented by this instance and the specified vector.

public Point3D

Returns:

the cross product of the two vectors
crossProduct
(Point3D
the other vector
vector
)

Computes cross product of the vector represented by this instance and the specified vector.

public double

Returns:

the distance between this point and point (x1, y1, z1).
distance
(double
the x coordinate of other point
x1
,
double
the y coordinate of other point
y1
,
double
the z coordinate of other point
z1
)

Computes the distance between this point and point (x1, y1, z1).

public double

Returns:

the distance between this point and the specified point.
distance
(Point3D
the other point
point
)

Computes the distance between this point and the specified point.

public double

Returns:

the dot product of the two vectors
dotProduct
(double
the X magnitude of the other vector
x
,
double
the Y magnitude of the other vector
y
,
double
the Z magnitude of the other vector
z
)

Computes dot (scalar) product of the vector represented by this instance and the specified vector.

public double

Returns:

the dot product of the two vectors
dotProduct
(Point3D
the other vector
vector
)

Computes dot (scalar) product of the vector represented by this instance and the specified vector.

public boolean

Returns:

true if this Point3D is the same as the obj argument; false otherwise
equals
(Object
the reference object with which to compare
obj
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public final double

Returns:

the x coordinate
getX
()

The x coordinate.

public final double

Returns:

the y coordinate
getY
()

The y coordinate.

public final double

Returns:

the z coordinate
getZ
()

The z coordinate.

public int

Returns:

a hash code for this Point3D object.
hashCode
()

Overrides java.lang.Object.hashCode.

Returns a hash code for this Point3D object.

public Point3D
interpolate(Point3D
the target value
endValue
,
double
the interpolation factor
t
)

Implements javafx.animation.Interpolatable.interpolate.

Returns an intermediate value between the value of this Interpolatable and the specified endValue using the linear interpolation factor t, ranging from 0 (inclusive) to 1 (inclusive).

public double

Returns:

magnitude of the vector
magnitude
()

Computes magnitude (length) of the relative magnitude vector represented by this instance.

public Point3D

Returns:

the point in the middle
midpoint
(double
the X coordinate of the second endpoint
x
,
double
the Y coordinate of the second endpoint
y
,
double
the Z coordinate of the second endpoint
z
)

Returns a point which lies in the middle between this point and the specified coordinates.

public Point3D

Returns:

the point in the middle
midpoint
(Point3D
the other endpoint
point
)

Returns a point which lies in the middle between this point and the specified point.

public Point3D

Returns:

the point with multiplied coordinates
multiply
(double
the factor multiplying the coordinates
factor
)

Returns a point with the coordinates of this point multiplied by the specified factor

public Point3D

Returns:

the normalized vector represented by a Point3D instance
normalize
()

Normalizes the relative magnitude vector represented by this instance.

public Point3D

Returns:

the point with subtracted coordinates
subtract
(double
the X coordinate subtraction
x
,
double
the Y coordinate subtraction
y
,
double
the Z coordinate subtraction
z
)

Returns a point with the specified coordinates subtracted from the coordinates of this point.

public Point3D

Returns:

the point with subtracted coordinates
subtract
(Point3D
the point whose coordinates are to be subtracted
point
)

Returns a point with the coordinates of the specified point subtracted from the coordinates of this point.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of this Point3D.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

hashback to summary
private int hash

Cache the hash code to make computing hashes faster.

xback to summary
private final double x

The x coordinate.

Default Value
0.0
yback to summary
private final double y

The y coordinate.

Default Value
0.0
zback to summary
private final double z

The z coordinate.

Default Value
0.0
ZEROback to summary
public static final Point3D ZERO

Point or vector with all three coordinates set to 0.

Constructor Detail

Point3Dback to summary
public Point3D(double x, double y, double z)

Creates a new instance of Point3D.

Parameters
x:double

The X coordinate of the Point3D

y:double

The Y coordinate of the Point3D

z:double

The Z coordinate of the Point3D

Method Detail

addback to summary
public Point3D add(double x, double y, double z)

Returns a point with the specified coordinates added to the coordinates of this point.

Parameters
x:double

the X coordinate addition

y:double

the Y coordinate addition

z:double

the Z coordinate addition

Returns:Point3D

the point with added coordinates

Since
JavaFX 8.0
addback to summary
public Point3D add(Point3D point)

Returns a point with the coordinates of the specified point added to the coordinates of this point.

Parameters
point:Point3D

the point whose coordinates are to be added

Returns:Point3D

the point with added coordinates

Exceptions
NullPointerException:
if the specified point is null
Since
JavaFX 8.0
angleback to summary
public double angle(double x, double y, double z)

Computes the angle (in degrees) between the vector represented by this point and the specified vector.

Parameters
x:double

the X magnitude of the other vector

y:double

the Y magnitude of the other vector

z:double

the Z magnitude of the other vector

Returns:double

the angle between the two vectors measured in degrees

Since
JavaFX 8.0
angleback to summary
public double angle(Point3D point)

Computes the angle (in degrees) between the vector represented by this point and the vector represented by the specified point.

Parameters
point:Point3D

the other vector

Returns:double

the angle between the two vectors measured in degrees, NaN if any of the two vectors is a zero vector

Exceptions
NullPointerException:
if the specified point is null
Since
JavaFX 8.0
angleback to summary
public double angle(Point3D p1, Point3D p2)

Computes the angle (in degrees) between the three points with this point as a vertex.

Parameters
p1:Point3D

one point

p2:Point3D

other point

Returns:double

angle between the vectors (this, p1) and (this, p2) measured in degrees, NaN if the three points are not different from one another

Exceptions
NullPointerException:
if the p1 or p2 is null
Since
JavaFX 8.0
crossProductback to summary
public Point3D crossProduct(double x, double y, double z)

Computes cross product of the vector represented by this instance and the specified vector.

Parameters
x:double

the X magnitude of the other vector

y:double

the Y magnitude of the other vector

z:double

the Z magnitude of the other vector

Returns:Point3D

the cross product of the two vectors

Since
JavaFX 8.0
crossProductback to summary
public Point3D crossProduct(Point3D vector)

Computes cross product of the vector represented by this instance and the specified vector.

Parameters
vector:Point3D

the other vector

Returns:Point3D

the cross product of the two vectors

Exceptions
NullPointerException:
if the specified vector is null
Since
JavaFX 8.0
distanceback to summary
public double distance(double x1, double y1, double z1)

Computes the distance between this point and point (x1, y1, z1).

Parameters
x1:double

the x coordinate of other point

y1:double

the y coordinate of other point

z1:double

the z coordinate of other point

Returns:double

the distance between this point and point (x1, y1, z1).

distanceback to summary
public double distance(Point3D point)

Computes the distance between this point and the specified point.

Parameters
point:Point3D

the other point

Returns:double

the distance between this point and the specified point.

Exceptions
NullPointerException:
if the specified point is null
dotProductback to summary
public double dotProduct(double x, double y, double z)

Computes dot (scalar) product of the vector represented by this instance and the specified vector.

Parameters
x:double

the X magnitude of the other vector

y:double

the Y magnitude of the other vector

z:double

the Z magnitude of the other vector

Returns:double

the dot product of the two vectors

Since
JavaFX 8.0
dotProductback to summary
public double dotProduct(Point3D vector)

Computes dot (scalar) product of the vector represented by this instance and the specified vector.

Parameters
vector:Point3D

the other vector

Returns:double

the dot product of the two vectors

Exceptions
NullPointerException:
if the specified vector is null
Since
JavaFX 8.0
equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one. Two instances of Point3D are equal if the return values of their getX, getY, and getZ methods are equal.

Parameters
obj:Object

the reference object with which to compare

Returns:boolean

true if this Point3D is the same as the obj argument; false otherwise

Annotations
@Override
getXback to summary
public final double getX()

The x coordinate.

Returns:double

the x coordinate

getYback to summary
public final double getY()

The y coordinate.

Returns:double

the y coordinate

getZback to summary
public final double getZ()

The z coordinate.

Returns:double

the z coordinate

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code for this Point3D object.

Returns:int

a hash code for this Point3D object.

Annotations
@Override
interpolateback to summary
public Point3D interpolate(Point3D endValue, double t)

Implements javafx.animation.Interpolatable.interpolate.

Doc from javafx.animation.Interpolatable.interpolate.

Returns an intermediate value between the value of this Interpolatable and the specified endValue using the linear interpolation factor t, ranging from 0 (inclusive) to 1 (inclusive).

The returned value might not be a new instance; the implementation might also return one of the two existing instances if the intermediate value would be equal to one of the existing values. However, this is an optimization and applications should not assume any particular identity of the returned value.

Parameters
endValue:Point3D

the target value

t:double

the interpolation factor

Returns:Point3D

the intermediate value

Annotations
@Override
Exceptions
NullPointerException:
if endValue is null
Since
13
magnitudeback to summary
public double magnitude()

Computes magnitude (length) of the relative magnitude vector represented by this instance.

Returns:double

magnitude of the vector

Since
JavaFX 8.0
midpointback to summary
public Point3D midpoint(double x, double y, double z)

Returns a point which lies in the middle between this point and the specified coordinates.

Parameters
x:double

the X coordinate of the second endpoint

y:double

the Y coordinate of the second endpoint

z:double

the Z coordinate of the second endpoint

Returns:Point3D

the point in the middle

Since
JavaFX 8.0
midpointback to summary
public Point3D midpoint(Point3D point)

Returns a point which lies in the middle between this point and the specified point.

Parameters
point:Point3D

the other endpoint

Returns:Point3D

the point in the middle

Exceptions
NullPointerException:
if the specified point is null
Since
JavaFX 8.0
multiplyback to summary
public Point3D multiply(double factor)

Returns a point with the coordinates of this point multiplied by the specified factor

Parameters
factor:double

the factor multiplying the coordinates

Returns:Point3D

the point with multiplied coordinates

Since
JavaFX 8.0
normalizeback to summary
public Point3D normalize()

Normalizes the relative magnitude vector represented by this instance. Returns a vector with the same direction and magnitude equal to 1. If this is a zero vector, a zero vector is returned.

Returns:Point3D

the normalized vector represented by a Point3D instance

Since
JavaFX 8.0
subtractback to summary
public Point3D subtract(double x, double y, double z)

Returns a point with the specified coordinates subtracted from the coordinates of this point.

Parameters
x:double

the X coordinate subtraction

y:double

the Y coordinate subtraction

z:double

the Z coordinate subtraction

Returns:Point3D

the point with subtracted coordinates

Since
JavaFX 8.0
subtractback to summary
public Point3D subtract(Point3D point)

Returns a point with the coordinates of the specified point subtracted from the coordinates of this point.

Parameters
point:Point3D

the point whose coordinates are to be subtracted

Returns:Point3D

the point with subtracted coordinates

Exceptions
NullPointerException:
if the specified point is null
Since
JavaFX 8.0
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representation of this Point3D. This method is intended to be used only for informational purposes. The content and format of the returned string might vary between implementations. The returned string might be empty but cannot be null.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

Annotations
@Override