org.jscience.chemistry.quantum.math.util
Class Point3D

java.lang.Object
  extended by org.jscience.chemistry.quantum.math.util.Point3D
All Implemented Interfaces:
java.lang.Cloneable

public class Point3D
extends java.lang.Object
implements java.lang.Cloneable

A class representing a point in 3D space.


Constructor Summary
Point3D()
          Creates a new instance of Point3D
Point3D(double x, double y, double z)
          Creates a new instance of Point3D
 
Method Summary
 Point3D add(Point3D b)
          addition of two points
 java.lang.Object clone()
          i do some cloning business ;)
 double distanceFrom(Point3D point)
          Simple method to find the distance between two points.
 double distanceSquaredFrom(Point3D point)
          Simple method to find the distance2 between two points.
 boolean equals(java.lang.Object obj)
          overloaded equals() method
 double getX()
          Getter for property x.
 double getY()
          Getter for property y.
 double getZ()
          Getter for property z.
 int hashCode()
          overriden hashCode() method
 Point3D mul(double k)
          multiplication of this point with a constant k
 void setX(double x)
          Setter for property x.
 void setY(double y)
          Setter for property y.
 void setZ(double z)
          Setter for property z.
 Point3D sub(Point3D b)
          substraction of two points (this - b)
 java.lang.String toString()
          overloaded toString() method.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Point3D

public Point3D()
Creates a new instance of Point3D


Point3D

public Point3D(double x,
               double y,
               double z)
Creates a new instance of Point3D

Parameters:
x - DOCUMENT ME!
y - DOCUMENT ME!
z - DOCUMENT ME!
Method Detail

getX

public double getX()
Getter for property x.

Returns:
Value of property x.

setX

public void setX(double x)
Setter for property x.

Parameters:
x - New value of property x.

getY

public double getY()
Getter for property y.

Returns:
Value of property y.

setY

public void setY(double y)
Setter for property y.

Parameters:
y - New value of property y.

getZ

public double getZ()
Getter for property z.

Returns:
Value of property z.

setZ

public void setZ(double z)
Setter for property z.

Parameters:
z - New value of property z.

toString

public java.lang.String toString()
overloaded toString() method.

Overrides:
toString in class java.lang.Object
Returns:
DOCUMENT ME!

equals

public boolean equals(java.lang.Object obj)
overloaded equals() method

Overrides:
equals in class java.lang.Object
Parameters:
obj - DOCUMENT ME!
Returns:
DOCUMENT ME!

distanceFrom

public double distanceFrom(Point3D point)
Simple method to find the distance between two points.

Parameters:
point - - the point to which the distance is to be found
Returns:
the distance between two points

distanceSquaredFrom

public double distanceSquaredFrom(Point3D point)
Simple method to find the distance2 between two points.

Parameters:
point - - the point to which the distance is to be found
Returns:
the distance between two points

add

public Point3D add(Point3D b)
addition of two points

Parameters:
b - : to be added to the current point
Returns:
the addition of two points

mul

public Point3D mul(double k)
multiplication of this point with a constant k

Parameters:
k - k : the constant to be multiplied to this point
Returns:
the result !

sub

public Point3D sub(Point3D b)
substraction of two points (this - b)

Parameters:
b - : to be substracted from the current point
Returns:
the substraction of two point

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
i do some cloning business ;)

Overrides:
clone in class java.lang.Object
Returns:
DOCUMENT ME!
Throws:
java.lang.CloneNotSupportedException - DOCUMENT ME!

hashCode

public int hashCode()
overriden hashCode() method

Overrides:
hashCode in class java.lang.Object
Returns:
int - the hashCode