math
Class Vector3D

java.lang.Object
  extended by math.Vector
      extended by math.Vector3D

public class Vector3D
extends Vector

a three dimensional vector extending the 4 vector the fourth component is therefor 0


Field Summary
 
Fields inherited from class math.Vector
w, x, y, z
 
Constructor Summary
Vector3D()
          standard constructor
Vector3D(double x, double y, double z)
          constructor, creates a vector from three doubles
Vector3D(Point3D start, Point3D end)
          constructor, creates a vector from a start and an end point
Vector3D(Vector3D v)
          copy constructor
 
Method Summary
 void add(Vector3D v)
          add a vector
 double dot(Vector3D v)
          returns the scalar product with a vector
 void minus(Vector3D v)
          subtracts a vector
 boolean normalize()
          normalize the vector
 void scale(double s)
          scales the vector with the double s
 void set(double x, double y, double z)
          sets the vector
 void set(Vector3D v)
          sets the vector
 
Methods inherited from class math.Vector
dot
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Vector3D

public Vector3D()
standard constructor


Vector3D

public Vector3D(double x,
                double y,
                double z)
constructor, creates a vector from three doubles

Parameters:
x -
y -
z -

Vector3D

public Vector3D(Vector3D v)
copy constructor

Parameters:
v - [in] vector

Vector3D

public Vector3D(Point3D start,
                Point3D end)
constructor, creates a vector from a start and an end point

Parameters:
start - [in] start point
end - [in] end point
Method Detail

normalize

public boolean normalize()
normalize the vector

Overrides:
normalize in class Vector
Returns:
success-state

dot

public double dot(Vector3D v)
returns the scalar product with a vector

Parameters:
v - [in] vector
Returns:
this dot v

scale

public void scale(double s)
scales the vector with the double s

Parameters:
s - scale

set

public void set(Vector3D v)
sets the vector

Parameters:
v - [in] vector

set

public void set(double x,
                double y,
                double z)
sets the vector

Parameters:
x -
y -
z -

add

public void add(Vector3D v)
add a vector

Parameters:
v - the vector to add

minus

public void minus(Vector3D v)
subtracts a vector

Parameters:
v - the vector to subtract