public abstract class Point3D extends java.lang.Object implements java.lang.Cloneable
Modifier and Type | Class and Description |
---|---|
static class |
Point3D.Double |
static class |
Point3D.Float |
static class |
Point3D.Integer |
Constructor and Description |
---|
Point3D() |
Modifier and Type | Method and Description |
---|---|
double |
angle(double x,
double y,
double z)
Computes the angle (in degrees) between the vector represented
by this point and the specified vector.
|
double |
angle(Point3D vector)
Computes the angle (in degrees) between the vector represented
by this point and the vector represented by the specified point.
|
double |
angle(Point3D p1,
Point3D p2)
Computes the angle (in degrees) between the three points with this point
as a vertex.
|
java.lang.Object |
clone()
Creates a new object of the same class as this object.
|
Point3D |
crossProduct(double x,
double y,
double z)
Computes cross product of the vector represented by this instance
and the specified vector.
|
Point3D |
crossProduct(Point3D vector)
Computes cross product of the vector represented by this instance
and the specified vector.
|
double |
distance(double x1,
double y1,
double z1)
Computes the distance between this point and point
(x1, y1, z1) . |
double |
distance(Point3D point)
Computes the distance between this point and the specified
point . |
double |
dotProduct(double x,
double y,
double z)
Computes dot (scalar) product of the vector represented by this instance
and the specified vector.
|
double |
dotProduct(Point3D vector)
Computes dot (scalar) product of the vector represented by this instance
and the specified vector.
|
boolean |
equals(java.lang.Object obj) |
static double |
getDistance(Point3D pt1,
Point3D pt2,
double factorX,
double factorY,
double factorZ)
Returns distance between 2 Point2D using specified scale factor for x/y/z dimension.
|
static double |
getTotalDistance(java.util.List<Point3D> points,
double factorX,
double factorY,
double factorZ,
boolean connectLastPoint)
Returns total distance of the specified list of points.
|
abstract double |
getX()
Returns the X coordinate of this
Point3D in double precision. |
abstract double |
getY()
Returns the Y coordinate of this
Point3D in double precision. |
abstract double |
getZ()
Returns the Z coordinate of this
Point3D in double precision. |
int |
hashCode() |
double |
length()
Computes length of the vector represented by this Point3D.
|
double |
magnitude()
Same as
length() |
Point3D |
midpoint(double x,
double y,
double z)
Returns a point which lies in the middle between this point and the
specified coordinates.
|
Point3D |
midpoint(Point3D point)
Returns a point which lies in the middle between this point and the
specified point.
|
double |
norm2()
Computes norm2 (square length) of the vector represented by this Point3D.
|
Point3D |
normalize()
Normalizes the relative magnitude vector represented by this instance.
|
void |
setLocation(double x,
double y,
double z)
Sets the location of this
Point3D to the
specified double coordinates. |
void |
setLocation(Point3D p)
Sets the location of this
Point3D to the same
coordinates as the specified Point3D object. |
abstract void |
setX(double x)
Sets the X coordinate of this
Point3D in double precision. |
abstract void |
setY(double y)
Sets the Y coordinate of this
Point3D in double precision. |
abstract void |
setZ(double z)
Sets the Z coordinate of this
Point3D in double precision. |
abstract java.awt.geom.Point2D |
toPoint2D()
Convert to 2D point
|
java.lang.String |
toString()
Returns a string representation of this
Point3D . |
void |
translate(double x,
double y,
double z)
Translate this
Point3D by the specified double coordinates. |
void |
translate(Point3D p)
Translate this
Point3D by the specified Point3D coordinates. |
public Point3D()
public static double getDistance(Point3D pt1, Point3D pt2, double factorX, double factorY, double factorZ)
public static double getTotalDistance(java.util.List<Point3D> points, double factorX, double factorY, double factorZ, boolean connectLastPoint)
public abstract double getX()
Point3D
in double
precision.Point3D
.public abstract double getY()
Point3D
in double
precision.Point3D
.public abstract double getZ()
Point3D
in double
precision.Point3D
.public abstract void setX(double x)
Point3D
in double
precision.public abstract void setY(double y)
Point3D
in double
precision.public abstract void setZ(double z)
Point3D
in double
precision.public void setLocation(double x, double y, double z)
Point3D
to the
specified double
coordinates.x
- the new X coordinate of this Point3D
y
- the new Y coordinate of this Point3D
z
- the new Z coordinate of this Point3D
public void setLocation(Point3D p)
Point3D
to the same
coordinates as the specified Point3D
object.p
- the specified Point3D
to which to set
this Point3D
public void translate(double x, double y, double z)
Point3D
by the specified double
coordinates.x
- the X translation valuey
- the Y translation valuez
- the Z translation valuepublic void translate(Point3D p)
Point3D
by the specified Point3D
coordinates.p
- the specified Point3D
used to translate this Point3D
public abstract java.awt.geom.Point2D toPoint2D()
public double distance(double x1, double y1, double z1)
(x1, y1, z1)
.x1
- the x coordinate of other pointy1
- the y coordinate of other pointz1
- the z coordinate of other point(x1, y1, z1)
.public double distance(Point3D point)
point
.point
- the other pointpoint
.java.lang.NullPointerException
- if the specified point
is nullpublic Point3D normalize()
Point3D
instancepublic Point3D midpoint(double x, double y, double z)
x
- the X coordinate of the second end pointy
- the Y coordinate of the second end pointz
- the Z coordinate of the second end pointpublic Point3D midpoint(Point3D point)
point
- the other end pointjava.lang.NullPointerException
- if the specified point
is nullpublic double angle(double x, double y, double z)
x
- the X magnitude of the other vectory
- the Y magnitude of the other vectorz
- the Z magnitude of the other vectorpublic double angle(Point3D vector)
vector
- the other vectorNaN
if any of the two vectors is a zero
vectorjava.lang.NullPointerException
- if the specified vector
is nullpublic double angle(Point3D p1, Point3D p2)
p1
- one pointp2
- other pointNaN
if the three points are not different
from one anotherjava.lang.NullPointerException
- if the p1
or p2
is nullpublic double norm2()
public double length()
public double dotProduct(double x, double y, double z)
x
- the X magnitude of the other vectory
- the Y magnitude of the other vectorz
- the Z magnitude of the other vectorpublic double dotProduct(Point3D vector)
vector
- the other vectorjava.lang.NullPointerException
- if the specified vector
is nullpublic Point3D crossProduct(double x, double y, double z)
x
- the X magnitude of the other vectory
- the Y magnitude of the other vectorz
- the Z magnitude of the other vectorpublic Point3D crossProduct(Point3D vector)
vector
- the other vectorjava.lang.NullPointerException
- if the specified vector
is nullpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.Object clone()
clone
in class java.lang.Object
java.lang.OutOfMemoryError
- if there is not enough memory.Cloneable
public int hashCode()
hashCode
in class java.lang.Object
Point3D
object.public java.lang.String toString()
Point3D
.
This method is intended to be used only for informational purposes.toString
in class java.lang.Object