Package jgromacs.data
Class Point3D
java.lang.Object
jgromacs.data.Point3D
- All Implemented Interfaces:
Cloneable
Objects of this class represent a single 3D point
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns an identical Point3D objectcrossProduct
(Point3D other) Returns the cross product of this vector and another vectordouble
Returns the Euclidean distance between this point and another pointboolean
Returns true if the two 3D points are identicaldouble
getX()
Returns the X coordinate of pointdouble
getY()
Returns the Y coordinate of pointdouble
getZ()
Returns the Z coordinate of pointint
hashCode()
Returns hash codedouble
innerProduct
(Point3D other) Returns the inner product of this vector and another vectordouble
length()
Returns the length of the vectorSubtracts another vector from this vectormultiplyByScalar
(double scalar) Returns this vector multiplied by a scalarAdds another vector to this vectorvoid
setX
(double x) Sets the X coordinate of pointvoid
setY
(double y) Sets the Y coordinate of pointvoid
setZ
(double z) Sets the Z coordinate of pointtoString()
Returns the String representation of pointtransformByMatrix
(Jama.Matrix matrix) Returns the resulting vector of a matrix transformation
-
Constructor Details
-
Point3D
public Point3D()Constructs a new Point3D object -
Point3D
public Point3D(double x, double y, double z) Constructs a new Point3D object with the given coordinates- Parameters:
x
- X coordinatey
- Y coordinatez
- Z coordinate
-
-
Method Details
-
getX
public double getX()Returns the X coordinate of point- Returns:
- X coordinate
-
setX
public void setX(double x) Sets the X coordinate of point- Parameters:
x
- X coordinate
-
getY
public double getY()Returns the Y coordinate of point- Returns:
- Y coordinate
-
setY
public void setY(double y) Sets the Y coordinate of point- Parameters:
y
- Y coordinate
-
getZ
public double getZ()Returns the Z coordinate of point- Returns:
- Z coordinate
-
setZ
public void setZ(double z) Sets the Z coordinate of point- Parameters:
z
- Z coordinate
-
distance
Returns the Euclidean distance between this point and another point- Parameters:
other
- another point- Returns:
- distance between points
-
plus
Adds another vector to this vector- Parameters:
other
- another vector- Returns:
- result vector
-
minus
Subtracts another vector from this vector- Parameters:
other
- another vector- Returns:
- result vector
-
innerProduct
Returns the inner product of this vector and another vector- Parameters:
other
- another vector- Returns:
- inner product
-
crossProduct
Returns the cross product of this vector and another vector- Parameters:
other
- another vector- Returns:
- cross product
-
multiplyByScalar
Returns this vector multiplied by a scalar- Parameters:
scalar
- scalar value- Returns:
- result vector
-
length
public double length()Returns the length of the vector- Returns:
- length of vector
-
transformByMatrix
Returns the resulting vector of a matrix transformation- Parameters:
matrix
- 3x3 transformation matrix- Returns:
- transformed vector
-
toString
Returns the String representation of point -
clone
Returns an identical Point3D object -
equals
Returns true if the two 3D points are identical -
hashCode
public int hashCode()Returns hash code
-