Package jgromacs.data
Class Point3D
- java.lang.Object
-
- jgromacs.data.Point3D
-
- All Implemented Interfaces:
java.lang.Cloneable
public class Point3D extends java.lang.Object implements java.lang.CloneableObjects of this class represent a single 3D point
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Returns an identical Point3D objectPoint3DcrossProduct(Point3D other)Returns the cross product of this vector and another vectordoubledistance(Point3D other)Returns the Euclidean distance between this point and another pointbooleanequals(java.lang.Object other)Returns true if the two 3D points are identicaldoublegetX()Returns the X coordinate of pointdoublegetY()Returns the Y coordinate of pointdoublegetZ()Returns the Z coordinate of pointinthashCode()Returns hash codedoubleinnerProduct(Point3D other)Returns the inner product of this vector and another vectordoublelength()Returns the length of the vectorPoint3Dminus(Point3D other)Subtracts another vector from this vectorPoint3DmultiplyByScalar(double scalar)Returns this vector multiplied by a scalarPoint3Dplus(Point3D other)Adds another vector to this vectorvoidsetX(double x)Sets the X coordinate of pointvoidsetY(double y)Sets the Y coordinate of pointvoidsetZ(double z)Sets the Z coordinate of pointjava.lang.StringtoString()Returns the String representation of pointPoint3DtransformByMatrix(Jama.Matrix matrix)Returns the resulting vector of a matrix transformation
-
-
-
Method Detail
-
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
public double distance(Point3D other)
Returns the Euclidean distance between this point and another point- Parameters:
other- another point- Returns:
- distance between points
-
plus
public Point3D plus(Point3D other)
Adds another vector to this vector- Parameters:
other- another vector- Returns:
- result vector
-
minus
public Point3D minus(Point3D other)
Subtracts another vector from this vector- Parameters:
other- another vector- Returns:
- result vector
-
innerProduct
public double innerProduct(Point3D other)
Returns the inner product of this vector and another vector- Parameters:
other- another vector- Returns:
- inner product
-
crossProduct
public Point3D crossProduct(Point3D other)
Returns the cross product of this vector and another vector- Parameters:
other- another vector- Returns:
- cross product
-
multiplyByScalar
public Point3D multiplyByScalar(double scalar)
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
public Point3D transformByMatrix(Jama.Matrix matrix)
Returns the resulting vector of a matrix transformation- Parameters:
matrix- 3x3 transformation matrix- Returns:
- transformed vector
-
toString
public java.lang.String toString()
Returns the String representation of point- Overrides:
toStringin classjava.lang.Object- Returns:
- String representation
-
clone
public java.lang.Object clone()
Returns an identical Point3D object- Overrides:
clonein classjava.lang.Object- Returns:
- clone of the point
-
equals
public boolean equals(java.lang.Object other)
Returns true if the two 3D points are identical- Overrides:
equalsin classjava.lang.Object- Parameters:
other- the other point
-
hashCode
public int hashCode()
Returns hash code- Overrides:
hashCodein classjava.lang.Object
-
-