public class Point3D
extends java.lang.Object
implements java.lang.Cloneable
Constructor and Description |
---|
Point3D()
Constructs a new Point3D object
|
Point3D(double x,
double y,
double z)
Constructs a new Point3D object with the given coordinates
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Returns an identical Point3D object
|
Point3D |
crossProduct(Point3D other)
Returns the cross product of this vector and another vector
|
double |
distance(Point3D other)
Returns the Euclidean distance between this point and another point
|
boolean |
equals(java.lang.Object other)
Returns true if the two 3D points are identical
|
double |
getX()
Returns the X coordinate of point
|
double |
getY()
Returns the Y coordinate of point
|
double |
getZ()
Returns the Z coordinate of point
|
int |
hashCode()
Returns hash code
|
double |
innerProduct(Point3D other)
Returns the inner product of this vector and another vector
|
double |
length()
Returns the length of the vector
|
Point3D |
minus(Point3D other)
Subtracts another vector from this vector
|
Point3D |
multiplyByScalar(double scalar)
Returns this vector multiplied by a scalar
|
Point3D |
plus(Point3D other)
Adds another vector to this vector
|
void |
setX(double x)
Sets the X coordinate of point
|
void |
setY(double y)
Sets the Y coordinate of point
|
void |
setZ(double z)
Sets the Z coordinate of point
|
java.lang.String |
toString()
Returns the String representation of point
|
Point3D |
transformByMatrix(Jama.Matrix matrix)
Returns the resulting vector of a matrix transformation
|
public Point3D()
public Point3D(double x, double y, double z)
x
- X coordinatey
- Y coordinatez
- Z coordinatepublic double getX()
public void setX(double x)
x
- X coordinatepublic double getY()
public void setY(double y)
y
- Y coordinatepublic double getZ()
public void setZ(double z)
z
- Z coordinatepublic double distance(Point3D other)
other
- another pointpublic Point3D plus(Point3D other)
other
- another vectorpublic Point3D minus(Point3D other)
other
- another vectorpublic double innerProduct(Point3D other)
other
- another vectorpublic Point3D crossProduct(Point3D other)
other
- another vectorpublic Point3D multiplyByScalar(double scalar)
scalar
- scalar valuepublic double length()
public Point3D transformByMatrix(Jama.Matrix matrix)
matrix
- 3x3 transformation matrixpublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- the other pointpublic int hashCode()
hashCode
in class java.lang.Object