ProGAL.geom3d
Class Vector.ImmutableVector3d

java.lang.Object
  extended by ProGAL.geomNd.Vector
      extended by ProGAL.geom3d.Vector
          extended by ProGAL.geom3d.Vector.ImmutableVector3d
Enclosing class:
Vector

public static class Vector.ImmutableVector3d
extends Vector

A wrapper class for 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.


Nested Class Summary
 
Nested classes/interfaces inherited from class ProGAL.geom3d.Vector
Vector.ImmutableVector3d
 
Field Summary
 
Fields inherited from class ProGAL.geom3d.Vector
X, Y, Z
 
Constructor Summary
Vector.ImmutableVector3d(double x, double y, double z)
           
 
Method Summary
 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
 
Methods inherited from class ProGAL.geom3d.Vector
add, add, addThis, angle, clone, cross, divide, divideThis, dot, getAngle, getCosDihedralAngle, getDihedralAngle, getOrthonormal, isParallel, isSteinerAngle, multiply, normalize, normalizeFast, normalizeThisFast, rotateIn, scaleToLength, set, subtract, subtractThis, toConsole, toConsole, toPoint, toScene, toString, toString, x, y, z
 
Methods inherited from class ProGAL.geomNd.Vector
add, addThis, angle, dot, equals, equals, get, getCoord, getDimensions, getLengthSquared, isZeroVector, length, outerProduct, setCoords, subtract, subtractThis
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Vector.ImmutableVector3d

public Vector.ImmutableVector3d(double x,
                                double y,
                                double z)
Method Detail

setCoord

public void setCoord(int i,
                     double v)
Description copied from class: Vector
Set the i'th coordinate to v

Overrides:
setCoord in class Vector

set

public void set(int i,
                double v)
Description copied from class: Vector
Set the i'th coordinate to v

Overrides:
set in class Vector

setX

public void setX(double x)
Description copied from class: Vector
Set the first coordinate

Overrides:
setX in class Vector

setY

public void setY(double y)
Description copied from class: Vector
Set the second coordinate

Overrides:
setY in class Vector

setZ

public void setZ(double z)
Description copied from class: Vector
Set the third coordinate

Overrides:
setZ in class Vector

addThis

public Vector addThis(Vector v)
Description copied from class: Vector
Add v to this vector and return the result (changing this object).

Overrides:
addThis in class Vector

multiplyThis

public Vector multiplyThis(double s)
Description copied from class: Vector
Multiply this vector by s and return the result (changing this object).

Overrides:
multiplyThis in class Vector

normalizeThis

public Vector normalizeThis()
Description copied from class: Vector
Normalize this vector and return the result (changing this object).

Overrides:
normalizeThis in class Vector

scaleToLengthThis

public Vector scaleToLengthThis(double length)
Description copied from class: Vector
Scale this vector to a certain length (changes this object).

Overrides:
scaleToLengthThis in class Vector

crossThis

public Vector crossThis(Vector v)
Description copied from class: Vector
Get the cross-product of this vector and v and store the result in this vector (changes this object).

Overrides:
crossThis in class Vector