java.lang.Object
org.jfree.chart3d.graphics3d.Point3D
- All Implemented Interfaces:
Serializable
A point in 3D space (this class is also used to represent vectors in 3D
space). Instances of this class are immutable.
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Point3D
createPoint3D
(double theta, double phi, double rho) Creates a newPoint3D
instance from spherical coordinates.boolean
Tests this instance for equality to an arbitrary object.double
getPhi()
Returns phi (calculated from the cartesian coordinates).double
getRho()
Returns rho (calculated from the cartesian coordinates).double
getTheta()
Returns theta (calculated from the cartesian coordinates).double
getX()
Returns the x-coordinate specified in the constructor.double
getY()
Returns the y-coordinate specified in the constructor.double
getZ()
Returns the z-coordinate specified in the constructor.int
hashCode()
toString()
Returns a string representation of this instance, primarily for debugging purposes.
-
Field Details
-
ORIGIN
The origin(0, 0, 0)
. -
UNIT_X
The point(1, 0, 0)
. -
UNIT_Y
The point(0, 1, 0)
. -
UNIT_Z
The point(0, 0, 1)
. -
x
The x-coordinate. -
y
The y-coordinate. -
z
The z-coordinate.
-
-
Constructor Details
-
Point3D
Creates a new point in 3D space.- Parameters:
x
- the x-coordinate.y
- the y-coordinate.z
- the z-coordinate.
-
-
Method Details
-
createPoint3D
Creates a newPoint3D
instance from spherical coordinates.- Parameters:
theta
- theta (in radians).phi
- phi (in radians).rho
- the distance from the origin.- Returns:
- The point (never
null
).
-
getX
Returns the x-coordinate specified in the constructor.- Returns:
- The x-coordinate.
-
getY
Returns the y-coordinate specified in the constructor.- Returns:
- The y-coordinate.
-
getZ
Returns the z-coordinate specified in the constructor.- Returns:
- The z-coordinate.
-
getTheta
Returns theta (calculated from the cartesian coordinates).- Returns:
- Theta.
-
getPhi
Returns phi (calculated from the cartesian coordinates).- Returns:
- phi.
-
getRho
Returns rho (calculated from the cartesian coordinates).- Returns:
- rho.
-
equals
Tests this instance for equality to an arbitrary object. -
hashCode
-
toString
Returns a string representation of this instance, primarily for debugging purposes.
-