public final class Vector extends ArrayVector
| Modifier and Type | Field and Description |
|---|---|
double[] |
data |
| Constructor and Description |
|---|
Vector(AVector source)
Copy constructor from an arbitrary vector
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(ArrayVector v) |
void |
add(AVector v)
Adds another vector to this one
|
void |
addMultiple(ArrayVector v,
double factor) |
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.
|
static Vector |
createLength(int length) |
void |
fill(double value)
Fills a vector with a given value
|
double |
get(int i) |
double[] |
getArray() |
int |
getArrayOffset() |
boolean |
isReference()
Returns true if this vector is of a type that references other vectors / data.
|
int |
length() |
void |
multiply(double factor)
Multiplies the vector by a constant factor
|
static Vector |
of(double... values) |
void |
set(int i,
double value) |
void |
sub(AVector v)
Subtracts a vector from this vector
|
void |
subtract(ArrayVector v) |
static Vector |
wrap(double[] source)
Wraps a double array into a Vector, does *no defensive copy* so use with caution
|
copy, copy, copyTo, magnitude, magnitudeSquared, subVectorabsolute, angle, clamp, clampMax, clampMin, compareTo, copyTo, distance, distanceL1, distanceLinf, distanceSquared, dotProduct, epsilonEquals, epsilonEquals, equals, hashCode, interpolate, interpolate, isMutable, isUnitLengthVector, isZeroVector, join, negate, normalise, projectToPlane, scale, scaleAdd, set, setValues, subMultiple, toArray, toList, toStringpublic Vector(AVector source)
source - public static Vector wrap(double[] source)
source - public static Vector of(double... values)
public static Vector createLength(int length)
public double[] getArray()
getArray in class ArrayVectorpublic int getArrayOffset()
getArrayOffset in class ArrayVectorpublic void fill(double value)
AVectorpublic void add(ArrayVector v)
add in class ArrayVectorpublic void addMultiple(ArrayVector v, double factor)
addMultiple in class ArrayVectorpublic void add(AVector v)
AVectorpublic void sub(AVector v)
AVectorpublic void subtract(ArrayVector v)
public void addMultiple(AVector v, double factor)
AVectoraddMultiple in class AVectorpublic void multiply(double factor)
AVectorpublic boolean isReference()
AVectorisReference in class AVectorCopyright © 2012. All Rights Reserved.