org.simtk.geometry3d
Class MathVectorClass
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
MathVectorClass
public MathVectorClass(int size)
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