org.shlublu.javax.math
Class Point3D

java.lang.Object
  |
  +--org.shlublu.javax.math.Point3D
All Implemented Interfaces:
java.lang.Cloneable, Point

public final class Point3D
extends java.lang.Object
implements Point

Creation : 2002/03/23 Class dedicated to implement 3D point operations

Since:
0.5

Field Summary
 double x
          x coordinate
 double y
          y coordinate
 double z
          z coordinate
 
Constructor Summary
Point3D()
          Empty constructor, init to (.0, .0, .0)
Point3D(double dblX, double dblY, double dblZ)
          Constructor, init to the given arguments
Point3D(Point3D p)
          Constructor, init to the given point
 
Method Summary
 java.lang.Object clone()
          Return a Point3D equals() to this one
 boolean equals(java.lang.Object o)
          True if o is not null, from the Point3D class without beeing from a subclass, and have the same coordinates in the same order than this.
 double getDistanceTo(Point3D pt)
          Get the distance between this and the given Point
 Point3D getTranslated(Vector3D v)
          Get the point corresponding to this translated by the given vector
 Vector3D getVector()
          Get the Vector corresponding to the translation from the origin to this Point
 Vector3D getVectorTo(Point3D pt)
          Get the vector between this and the given Point
 java.lang.String toString()
          Get this point as a string
 void translate(Vector3D v)
          Translate this point using the given vector
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public double x
x coordinate

y

public double y
y coordinate

z

public double z
z coordinate
Constructor Detail

Point3D

public Point3D()
Empty constructor, init to (.0, .0, .0)

Point3D

public Point3D(double dblX,
               double dblY,
               double dblZ)
Constructor, init to the given arguments

Point3D

public Point3D(Point3D p)
Constructor, init to the given point
Method Detail

toString

public java.lang.String toString()
Get this point as a string
Specified by:
toString in interface Point
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
True if o is not null, from the Point3D class without beeing from a subclass, and have the same coordinates in the same order than this.
Specified by:
equals in interface Point
Overrides:
equals in class java.lang.Object

clone

public java.lang.Object clone()
Return a Point3D
equals()
to this one
Specified by:
clone in interface Point
Overrides:
clone in class java.lang.Object

getVector

public Vector3D getVector()
Get the Vector corresponding to the translation from the origin to this Point

translate

public void translate(Vector3D v)
Translate this point using the given vector

getTranslated

public Point3D getTranslated(Vector3D v)
Get the point corresponding to this translated by the given vector

getDistanceTo

public double getDistanceTo(Point3D pt)
Get the distance between this and the given Point

getVectorTo

public Vector3D getVectorTo(Point3D pt)
Get the vector between this and the given Point