org.simtk.geometry3d
Class MathVectorClass

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

public class MathVectorClass
extends java.lang.Object
implements MutableMathVector


Constructor Summary
MathVectorClass(int size)
           
 
Method Summary
 void copy(MathVector v2)
          copy contents of argument vector into this one
 double distance(MathVector v2)
           
 double distanceSquared(MathVector v2)
           
 double dot(MathVector v2)
           
 double get(int i)
           
 int getDimension()
           
 double getElement(int i)
           
 java.util.Iterator iterator()
           
 double length()
           
 double lengthSquared()
           
 MathVector minus(MathVector v2)
           
 void minusEquals(MathVector v2)
           
 MathVector plus(MathVector v2)
           
 void plusEquals(MathVector v2)
           
 void selfUnit()
           
 void set(int i, double d)
           
 MathVector times(double s)
           
 void timesEquals(double s)
           
 java.lang.String toString()
           
 MathVector unit()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MathVectorClass

public MathVectorClass(int size)
Method Detail

get

public double get(int i)
Specified by:
get in interface MathVector

getElement

public double getElement(int i)
Specified by:
getElement in interface MathVector

copy

public void copy(MathVector v2)
copy contents of argument vector into this one

Specified by:
copy in interface MutableMathVector
Parameters:
v2 -

set

public void set(int i,
                double d)
Specified by:
set in interface MutableMathVector

getDimension

public int getDimension()
Specified by:
getDimension in interface MathVector

plus

public MathVector plus(MathVector v2)
Specified by:
plus in interface MathVector

plusEquals

public void plusEquals(MathVector v2)
Specified by:
plusEquals in interface MutableMathVector

minusEquals

public void minusEquals(MathVector v2)
Specified by:
minusEquals in interface MutableMathVector

minus

public MathVector minus(MathVector v2)
Specified by:
minus in interface MathVector

dot

public double dot(MathVector v2)
Specified by:
dot in interface MathVector

lengthSquared

public double lengthSquared()
Specified by:
lengthSquared in interface MathVector

length

public double length()
Specified by:
length in interface MathVector

distance

public double distance(MathVector v2)
Specified by:
distance in interface MathVector

distanceSquared

public double distanceSquared(MathVector v2)
Specified by:
distanceSquared in interface MathVector

unit

public MathVector unit()
Specified by:
unit in interface MathVector

selfUnit

public void selfUnit()
Specified by:
selfUnit in interface MutableMathVector

times

public MathVector times(double s)
Specified by:
times in interface MathVector

timesEquals

public void timesEquals(double s)
Specified by:
timesEquals in interface MutableMathVector

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface java.lang.Iterable

toString

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