org.shlublu.javax.math
Class Vector3D

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

public final class Vector3D
extends java.lang.Object
implements Vector

Creation : 2002/03/21 Class dedicated to implement 3D vector operations

Since:
0.5

Field Summary
 double x
          x coordinate
 double y
          y coordinate
 double z
          z coordinate
 
Constructor Summary
Vector3D()
          Empty constructor, init to (.0, .0, .0)
Vector3D(double dblX, double dblY, double dblZ)
          Constructor, init to the given arguments
Vector3D(Vector3D v)
          Constructor, init to the given vector
 
Method Summary
 void add(Vector3D v)
          Add the given vector
 java.lang.Object clone()
          Return a Vector3D equals() to this one
 Vector3D crossProduct(Vector3D v)
          Get the cross product with the given vector
 void divide(double d)
          Divide this vector
 boolean equals(java.lang.Object o)
          True if o is not null, from the Vector3D class without beeing from a subclass, and have the same coordinates in the same order than this.
 void equilibrate()
          Equilibrate this vector
 Vector3D getDifference(Vector3D vToSubstract)
          Get the difference vector
 Vector3D getDivided(double d)
          Get the divided vector corresponding to this one
 Vector3D getEquilibrated()
          Return an equilibrated vector corresponding to this
 Vector3D getNormalized()
          Return a normalized vector corresponding to this
 Point3D getPoint()
          Get the Point corresponding to this Vector
 Vector3D getProduct(double d)
          Get the multiplied vector corresponding to this one
 Vector3D getProjected(Vector3D v)
          Get the projection on this of the given vector
 Vector3D getSum(Vector3D vToAdd)
          Get the sum vector
 void multiply(double d)
          Multiply this vector
 double norm()
          Get this vector's norm
 void normalize()
          Normalize this vector
 Vector3D projectOn(Vector3D v)
          Get the projection on the given vector of this
 double scalarProduct(Vector3D v)
          Get the scalar (or dot) product with the given vector
 void substract(Vector3D v)
          Substract the given vector
 java.lang.String toString()
          Get this vector as a string
 
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

Vector3D

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

Vector3D

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

Vector3D

public Vector3D(Vector3D v)
Constructor, init to the given vector
Method Detail

toString

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

equals

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

clone

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

getPoint

public Point3D getPoint()
Get the Point corresponding to this Vector

norm

public double norm()
Get this vector's norm
Specified by:
norm in interface Vector

normalize

public void normalize()
Normalize this vector
Specified by:
normalize in interface Vector

getNormalized

public Vector3D getNormalized()
Return a normalized vector corresponding to this

equilibrate

public void equilibrate()
Equilibrate this vector
Specified by:
equilibrate in interface Vector

getEquilibrated

public Vector3D getEquilibrated()
Return an equilibrated vector corresponding to this

multiply

public void multiply(double d)
Multiply this vector
Specified by:
multiply in interface Vector

getProduct

public Vector3D getProduct(double d)
Get the multiplied vector corresponding to this one

divide

public void divide(double d)
Divide this vector
Specified by:
divide in interface Vector

getDivided

public Vector3D getDivided(double d)
Get the divided vector corresponding to this one

add

public void add(Vector3D v)
Add the given vector

getSum

public Vector3D getSum(Vector3D vToAdd)
Get the sum vector

substract

public void substract(Vector3D v)
Substract the given vector

getDifference

public Vector3D getDifference(Vector3D vToSubstract)
Get the difference vector

scalarProduct

public double scalarProduct(Vector3D v)
Get the scalar (or dot) product with the given vector

crossProduct

public Vector3D crossProduct(Vector3D v)
Get the cross product with the given vector

getProjected

public Vector3D getProjected(Vector3D v)
Get the projection on this of the given vector

projectOn

public Vector3D projectOn(Vector3D v)
Get the projection on the given vector of this