public final class Point3D extends java.lang.Object implements java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
static Point3D |
ORIGIN
The origin
(0, 0, 0). |
static Point3D |
UNIT_X
The point
(1, 0, 0). |
static Point3D |
UNIT_Y
The point
(0, 1, 0). |
static Point3D |
UNIT_Z
The point
(0, 0, 1). |
double |
x
The x-coordinate.
|
double |
y
The y-coordinate.
|
double |
z
The z-coordinate.
|
| Constructor and Description |
|---|
Point3D(double x,
double y,
double z)
Creates a new point in 3D space.
|
| Modifier and Type | Method and Description |
|---|---|
static Point3D |
createPoint3D(double theta,
double phi,
double rho)
Creates a new
Point3D instance from spherical coordinates. |
boolean |
equals(java.lang.Object obj)
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() |
java.lang.String |
toString()
Returns a string representation of this instance, primarily for
debugging purposes.
|
public double x
public double y
public double z
public Point3D(double x, double y, double z)
x - the x-coordinate.y - the y-coordinate.z - the z-coordinate.public static Point3D createPoint3D(double theta, double phi, double rho)
Point3D instance from spherical coordinates.theta - theta (in radians).phi - phi (in radians).rho - the distance from the origin.null).public double getX()
public double getY()
public double getZ()
public double getTheta()
public double getPhi()
public double getRho()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the object (null permitted).public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectnull).