org.simtk.geometry3d
Class Vector3DClass

java.lang.Object
  extended by org.simtk.geometry3d.MathVectorClass
      extended by org.simtk.geometry3d.Vector3DClass
All Implemented Interfaces:
java.lang.Iterable, Location, MathVector, MutableMathVector, MutableVector3D, Vector3D
Direct Known Subclasses:
Vector3DFloatArrayWrapper

public class Vector3DClass
extends MathVectorClass
implements MutableVector3D

Author:
Christopher Bruns A point or direction vector in three dimensions.

Field Summary
static Vector3D X_AXIS
           
static Vector3D Y_AXIS
           
static Vector3D Z_AXIS
           
 
Constructor Summary
Vector3DClass()
           
Vector3DClass(double[] vec)
           
Vector3DClass(double x, double y, double z)
           
Vector3DClass(MathVector template)
           
 
Method Summary
static Vector3D centroid(java.util.Collection<Vector3D> bagOfPoints)
          Compute the centroid or mean point
static Vector3D centroid(Vector3D[] coordinates, double[] weights)
           
 void copy(MathVector v2)
          copy contents of argument vector into this one
 Vector3D cross(Vector3D v2)
           
 boolean equals(java.lang.Object v)
           
 double getX()
           
 double getY()
           
 double getZ()
           
 int hashCode()
           
protected  void initialize(Vector3D v2)
           
 Vector3D minus(MathVector v2)
           
 Vector3D plus(MathVector v2)
           
 Vector3D rotate(Vector3D axis, double angle)
           
 void setX(double d)
           
 void setY(double d)
           
 void setZ(double d)
           
 Vector3D times(double s)
           
 double[] toArray()
           
 java.lang.String toString()
           
 Vector3D unit()
           
 double x()
           
 double y()
           
 double z()
           
 
Methods inherited from class org.simtk.geometry3d.MathVectorClass
distance, distanceSquared, dot, get, getDimension, getElement, iterator, length, lengthSquared, minusEquals, plusEquals, selfUnit, set, timesEquals
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.simtk.geometry3d.MathVector
distance, distanceSquared, dot, get, getDimension, getElement, length, lengthSquared
 
Methods inherited from interface java.lang.Iterable
iterator
 
Methods inherited from interface org.simtk.geometry3d.MutableMathVector
minusEquals, plusEquals, selfUnit, set, timesEquals
 
Methods inherited from interface org.simtk.geometry3d.MathVector
distance, distanceSquared, dot, get, getDimension, getElement, length, lengthSquared
 
Methods inherited from interface java.lang.Iterable
iterator
 

Field Detail

X_AXIS

public static final Vector3D X_AXIS

Y_AXIS

public static final Vector3D Y_AXIS

Z_AXIS

public static final Vector3D Z_AXIS
Constructor Detail

Vector3DClass

public Vector3DClass()

Vector3DClass

public Vector3DClass(double x,
                     double y,
                     double z)

Vector3DClass

public Vector3DClass(double[] vec)

Vector3DClass

public Vector3DClass(MathVector template)
Method Detail

copy

public void copy(MathVector v2)
Description copied from class: MathVectorClass
copy contents of argument vector into this one

Specified by:
copy in interface MutableMathVector
Overrides:
copy in class MathVectorClass

initialize

protected void initialize(Vector3D v2)

setX

public void setX(double d)
Specified by:
setX in interface MutableVector3D

setY

public void setY(double d)
Specified by:
setY in interface MutableVector3D

setZ

public void setZ(double d)
Specified by:
setZ in interface MutableVector3D

getX

public double getX()
Specified by:
getX in interface Vector3D

getY

public double getY()
Specified by:
getY in interface Vector3D

getZ

public double getZ()
Specified by:
getZ in interface Vector3D

x

public double x()
Specified by:
x in interface Vector3D

y

public double y()
Specified by:
y in interface Vector3D

z

public double z()
Specified by:
z in interface Vector3D

unit

public Vector3D unit()
Specified by:
unit in interface MathVector
Specified by:
unit in interface Vector3D
Overrides:
unit in class MathVectorClass

minus

public Vector3D minus(MathVector v2)
Specified by:
minus in interface MathVector
Specified by:
minus in interface Vector3D
Overrides:
minus in class MathVectorClass

plus

public Vector3D plus(MathVector v2)
Specified by:
plus in interface MathVector
Specified by:
plus in interface Vector3D
Overrides:
plus in class MathVectorClass

times

public Vector3D times(double s)
Specified by:
times in interface MathVector
Specified by:
times in interface Vector3D
Overrides:
times in class MathVectorClass

centroid

public static Vector3D centroid(java.util.Collection<Vector3D> bagOfPoints)
                         throws InsufficientPointsException
Compute the centroid or mean point

Throws:
InsufficientPointsException

centroid

public static Vector3D centroid(Vector3D[] coordinates,
                                double[] weights)
                         throws InsufficientPointsException
Throws:
InsufficientPointsException

cross

public Vector3D cross(Vector3D v2)
Specified by:
cross in interface Vector3D

toString

public java.lang.String toString()
Overrides:
toString in class MathVectorClass

equals

public boolean equals(java.lang.Object v)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

rotate

public Vector3D rotate(Vector3D axis,
                       double angle)
Specified by:
rotate in interface Vector3D

toArray

public double[] toArray()
Specified by:
toArray in interface Vector3D