model
Class Vector3d

java.lang.Object
  extended by model.Vector3d

public class Vector3d
extends java.lang.Object

A 3d vector used to calculate cross-products for normal vectors.


Field Summary
static int SIZE
           
 
Constructor Summary
Vector3d()
           
Vector3d(double[] v)
           
Vector3d(Vector3d v)
           
 
Method Summary
static Vector3d crossProduct(double[] v1, double[] v2)
          Returns the cross product of the specified vectors.
 double[] getNormalized()
           
 double[] getVector()
           
 double[] normalize()
          Returns the normalization of this vector.
 void setVector(double[] v)
           
 void setVector(Vector3d v)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIZE

public static final int SIZE
See Also:
Constant Field Values
Constructor Detail

Vector3d

public Vector3d()

Vector3d

public Vector3d(double[] v)

Vector3d

public Vector3d(Vector3d v)
Method Detail

setVector

public void setVector(double[] v)

setVector

public void setVector(Vector3d v)

getVector

public double[] getVector()

getNormalized

public double[] getNormalized()

crossProduct

public static Vector3d crossProduct(double[] v1,
                                    double[] v2)
Returns the cross product of the specified vectors.

Parameters:
v1 - first vector
v2 - second vector
Returns:
cross product

normalize

public double[] normalize()
Returns the normalization of this vector.

Returns:
this vector, normalized