public class Point3D
extends java.lang.Object
Constructor and Description |
---|
Point3D(double x,
double y,
double z)
Initializes a new instance of the
Point3D class. |
Modifier and Type | Method and Description |
---|---|
static Point3D |
add(Point3D p1,
Point3D p2)
Sums two points' coordinates.
|
double |
distance(Point3D p)
Gets the distance to specified point.
|
double |
getX()
Gets the X coordinate of this point.
|
double |
getY()
Gets the Y coordinate of this point.
|
double |
getZ()
Gets the Z coordinate of this point.
|
Point3D |
scale(double scale)
Scales the point's coordinates by specified scale factor.
|
void |
setX(double value)
Sets the X coordinate of this point.
|
void |
setY(double value)
Sets the Y coordinate of this point.
|
void |
setZ(double value)
Sets the Z coordinate of this point.
|
java.lang.String |
toString()
Object.ToString override.
|
public Point3D(double x, double y, double z)
Point3D
class.x
- X coordinate of the point.y
- Y coordinate of the point.z
- Z coordinate of the point.public double distance(Point3D p)
p
- A Point3D instance.public static Point3D add(Point3D p1, Point3D p2)
p1
- The first point.p2
- The second point.public Point3D scale(double scale)
scale
- A double value by which to multiply point's coordinates.public java.lang.String toString()
toString
in class java.lang.Object
public double getX()
public void setX(double value)
public double getY()
public void setY(double value)
public double getZ()
public void setZ(double value)