public abstract class AVector extends Object implements Cloneable, Comparable<AVector>
| Constructor and Description |
|---|
AVector() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(AVector v)
Adds another vector to this one
|
void |
addMultiple(AVector v,
double factor)
Adds a scaled multiple of another vector to this one
|
AVector |
clone()
Clones the vector, creating a new copy of all data
|
int |
compareTo(AVector a) |
void |
copyTo(double[] data,
int offset)
Copies a the contents of a vector to a double array at the specified offset
|
double |
dotProduct(AVector v) |
boolean |
equals(Object o)
Test for equality on vectors.
|
void |
fill(double value)
Fills a vector with a given value
|
abstract double |
get(int i) |
int |
hashCode() |
abstract int |
length() |
double |
magnitude()
Returns the magnitude (Euclidean length) of the vector
|
double |
magnitudeSquared() |
void |
multiply(double factor)
Multiplies the vector by a constant factor
|
void |
normalise() |
abstract void |
set(int i,
double value) |
void |
subtract(AVector v)
Subtracts a vector from this vector
|
void |
subtractMultiple(AVector v,
double factor)
Subtracts a scaled multiple of another vector from this vector
|
AVector |
subVector(int offset,
int length) |
String |
toString() |
public abstract int length()
public abstract double get(int i)
public abstract void set(int i,
double value)
public AVector subVector(int offset, int length)
public int compareTo(AVector a)
compareTo in interface Comparable<AVector>public boolean equals(Object o)
public void copyTo(double[] data,
int offset)
public void fill(double value)
value - public void multiply(double factor)
factor - Factor by which to multiply each component of the vectorpublic double magnitudeSquared()
public double dotProduct(AVector v)
public double magnitude()
public void normalise()
public AVector clone()
public void add(AVector v)
v - public void addMultiple(AVector v, double factor)
v - public void subtract(AVector v)
v - public void subtractMultiple(AVector v, double factor)
v - Copyright © 2012. All Rights Reserved.