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, z
add, addThis, angle, dot, equals, equals, get, getCoord, getDimensions, getLengthSquared, isZeroVector, length, outerProduct, randomVector, setCoords, subtract, subtractThis
public void setCoord(int i, double v)
Vector
public void set(int i, double v)
Vector
public void setX(double x)
Vector
public void setY(double y)
Vector
public void setZ(double z)
Vector
public Vector addThis(Vector v)
Vector
public Vector multiplyThis(double s)
Vector
multiplyThis
in class Vector
public Vector normalizeThis()
Vector
normalizeThis
in class Vector
public Vector scaleToLengthThis(double length)
Vector
scaleToLengthThis
in class Vector