|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--org.crwth.systems.Vector
A generic Vector class. A Vector is a vector with support
for inversion and magnitude.
| Constructor Summary | |
Vector()
|
|
| Method Summary | |
abstract void |
add(Vector vector)
Adds one vector to another. |
abstract boolean |
equals(Vector vector)
Returns true if the coordinates of the object and vector differ by less than a defined epsilon value. |
abstract int |
getDimension()
Returns the dimension of the Vector. |
abstract double |
getDistance(Vector vector)
Returns the distance to another Vector. |
abstract Vector |
getInverse()
Returns a Vector that is inverted along all axes to this object, maintaining the same magnitude. |
abstract double |
getMagnitude()
Returns the magnitude of the object. |
abstract Vector |
getNormal()
Returns a normal Vector to this Vector; that is, a Vector of magnitude 1 in the same direction as the object. |
abstract Vector |
getVector(Vector vector)
Returns a Vector from the object to the endpoint of vector. |
abstract void |
invert()
Inverts the object along all axes. |
abstract void |
normalize()
Sets the object's magnitude to 1. |
abstract void |
setMagnitude(double magnitude)
Sets the magnitude of the object. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Vector()
| Method Detail |
public abstract double getDistance(Vector vector)
throws WrongDimensionException
vector - the other vector.
vector
WrongDimensionException - if vector has a mismatched dimension.
public abstract void add(Vector vector)
throws WrongDimensionException
vector - the Vector to add to the object.
WrongDimensionException - if vector has a mismatched dimension.
public abstract Vector getVector(Vector vector)
throws WrongDimensionException
vector.
vector - the Vector to calculate to.
vector.
WrongDimensionException - if vector has a mismatched dimension.public abstract int getDimension()
public abstract boolean equals(Vector vector)
throws WrongDimensionException
vector differ by less than a defined epsilon value.
vector - the Vector to compare.
WrongDimensionException - if vector has a mismatched dimension.public abstract void invert()
public abstract Vector getInverse()
public abstract void setMagnitude(double magnitude)
magnitude - the new magnitude.public abstract double getMagnitude()
public abstract void normalize()
setMagnitude(1.0).
public abstract Vector getNormal()
public String toString()
toString in class Object
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||