public static class Vector.ImmutableVector3d extends Vector
Vector3d which makes the vector immutable.
All methods that can change the x, y and z-coordinates are overwritten. If
e.g. setX(0.1) is called a RuntimeException is thrown. If any of the
arithmetic methods such as multiplyThis are called, the result of
their corresponding non-mutating variant (multiply) is returned instead.Vector.ImmutableVector3d| Constructor and Description |
|---|
ImmutableVector3d(double x,
double y,
double z) |
| Modifier and Type | Method and Description |
|---|---|
Vector |
addThis(Vector v)
Add v to this vector and return the result (changing this object).
|
Vector |
crossThis(Vector v)
Get the cross-product of this vector and v and store the result in this vector (changes this object).
|
Vector |
multiplyThis(double s)
Multiply this vector by s and return the result (changing this object).
|
Vector |
normalizeThis()
Normalize this vector and return the result (changing this object).
|
Vector |
scaleToLengthThis(double length)
Scale this vector to a certain length (changes this object).
|
void |
set(int i,
double v)
Set the i'th coordinate to v
|
void |
setCoord(int i,
double v)
Set the i'th coordinate to v
|
void |
setX(double x)
Set the first coordinate
|
void |
setY(double y)
Set the second coordinate
|
void |
setZ(double z)
Set the third coordinate
|
add, add, addThis, angle, clone, cross, divide, divideThis, dot, dot, getAngle, getCosDihedralAngle, getDihedralAngle, getOrthogonal, getOrthonormal, isParallel, isSteinerAngle, main, multiply, multiply, normalize, normalizeFast, normalizeThisFast, rotateIn, rotation, scaleToLength, set, subtract, subtractThis, toConsole, toConsole, toPoint, toString, toString, x, y, zadd, addThis, angle, dot, equals, equals, get, getCoord, getDimensions, getLengthSquared, isZeroVector, length, outerProduct, randomVector, setCoords, subtract, subtractThispublic void setCoord(int i,
double v)
Vectorpublic void set(int i,
double v)
Vectorpublic void setX(double x)
Vectorpublic void setY(double y)
Vectorpublic void setZ(double z)
Vectorpublic Vector addThis(Vector v)
Vectorpublic Vector multiplyThis(double s)
VectormultiplyThis in class Vectorpublic Vector normalizeThis()
VectornormalizeThis in class Vectorpublic Vector scaleToLengthThis(double length)
VectorscaleToLengthThis in class Vector