convexhull3d
Class SpatialVector

java.lang.Object
  |
  +--convexhull3d.SpatialVector

public class SpatialVector
extends java.lang.Object

Bare bones 3D spatial vector.

Author:
John E. Lloyd, Winter 2003

Field Summary
 double x
          The x coordinate.
 double y
          The y coordinate.
 double z
          The z coordinate.
 
Constructor Summary
SpatialVector()
          Constructs and initializes a SpatialVector to (0,0,0).
SpatialVector(double x, double y, double z)
          Constructs and initializes a SpatialVector to (x,y,z).
 
Method Summary
 double dot(SpatialVector v)
          Returns the dot product of this vector and vector v1.
 double length()
          Returns the length of this vector.
 double lengthSquared()
          Returns the squared length of this vector.
 void normalize()
          Normalizes this vector so that it has unit length.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

public double x
The x coordinate.


y

public double y
The y coordinate.


z

public double z
The z coordinate.

Constructor Detail

SpatialVector

public SpatialVector()
Constructs and initializes a SpatialVector to (0,0,0).


SpatialVector

public SpatialVector(double x,
                     double y,
                     double z)
Constructs and initializes a SpatialVector to (x,y,z).

Parameters:
x - the x coordinate
y - the y coordinate
z - the z coordinate
Method Detail

normalize

public void normalize()
Normalizes this vector so that it has unit length.


length

public double length()
Returns the length of this vector.

Returns:
the length of this vector.

lengthSquared

public double lengthSquared()
Returns the squared length of this vector.

Returns:
the squared length of this vector.

dot

public double dot(SpatialVector v)
Returns the dot product of this vector and vector v1.

Returns:
the dot product of this and v1.