noope.core
Class MutableVector3D

java.lang.Object
  |
  +--noope.core.Vector3D
        |
        +--noope.core.MutableVector3D

public class MutableVector3D
extends Vector3D

A mutable extension of Vector3D.

Author:
Paul Evans

Fields inherited from class noope.core.Vector3D
ex, ey, ez, x, y, z
 
Constructor Summary
MutableVector3D()
          Construct a MutableVector3D and initialise it to (0, 0, 0).
MutableVector3D(double new_x, double new_y, double new_z)
          Construct a MutableVector3D and initialise it to (new_x, new_y, new_z).
MutableVector3D(java.lang.String s)
          Construct a new MutableVector3D by parsing a string.
MutableVector3D(Vector3D v)
          Construct a MutableVector3D equal to v.
 
Method Summary
 void addInplace(Vector3D v)
          Increment this Vector3D by the Vector3D v inplace.
 void multScalarInplace(double d)
          Multiply each component of this Vector3D by the scalar d inplace.
 void setX(double new_x)
          Set the x component of this Vector3D
 void setY(double new_y)
          Set the y component of this Vector3D
 void setZ(double new_z)
          Set the z component of this Vector3D
 void subtractInplace(Vector3D v)
          Decrement this Vector3D by the Vector3D v inplace.
 
Methods inherited from class noope.core.Vector3D
add, crossProduct, dotProduct, equals, equals, getModulus, getModulusSquared, getUnitVector, getX, getY, getZ, hashCode, multScalar, negative, subtract, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MutableVector3D

public MutableVector3D()
Construct a MutableVector3D and initialise it to (0, 0, 0).

MutableVector3D

public MutableVector3D(double new_x,
                       double new_y,
                       double new_z)
Construct a MutableVector3D and initialise it to (new_x, new_y, new_z).
Parameters:
new_x - x component
new_y - y component
new_z - z component

MutableVector3D

public MutableVector3D(Vector3D v)
Construct a MutableVector3D equal to v.
Parameters:
v - the vector to copy from

MutableVector3D

public MutableVector3D(java.lang.String s)
                throws java.text.ParseException
Construct a new MutableVector3D by parsing a string. Parses the String s for a Vector3D given in the form (x, y, z) where x, y and z are doubles. All whitespace is stripped and "0" is recognised to mean the zero vector (0, 0, 0).
Parameters:
s - the string to parse
Throws:
java.text.ParseException - if there was an error parsing the string
Method Detail

setX

public void setX(double new_x)
Set the x component of this Vector3D
Parameters:
new_x - x component

setY

public void setY(double new_y)
Set the y component of this Vector3D
Parameters:
new_y - y component

setZ

public void setZ(double new_z)
Set the z component of this Vector3D
Parameters:
new_z - z component

multScalarInplace

public void multScalarInplace(double d)
Multiply each component of this Vector3D by the scalar d inplace.

addInplace

public void addInplace(Vector3D v)
Increment this Vector3D by the Vector3D v inplace.

subtractInplace

public void subtractInplace(Vector3D v)
Decrement this Vector3D by the Vector3D v inplace.