marchingcubes
Class MCVector3

java.lang.Object
  |
  +--marchingcubes.MCVector3

public class MCVector3
extends java.lang.Object


Field Summary
protected  double x
           
protected  double y
           
protected  double z
           
 
Constructor Summary
MCVector3()
          default contructor of a MCVector3 object
MCVector3(double x, double y, double z)
          contructor of a MCVector3 object
MCVector3(marchingcubes.MCVector3 v)
          copy contructor of a MCVector3 object
MCVector3(marchingcubes.MCVector4 v)
          contructor of a MCVector3 object from a four dimensional vector
 
Method Summary
 marchingcubes.MCVector3 add(double x, double y, double z)
          adds values to the vectors components
 marchingcubes.MCVector3 add(marchingcubes.MCVector3 v)
          performs an addition between two vectors
 marchingcubes.MCVector3 cross(marchingcubes.MCVector3 v)
          compute cross product
 marchingcubes.MCVector3 div(double k)
          performs a division by a scalar
 double dot(marchingcubes.MCVector3 v)
          compute dot product
 double length()
          returns the length of the vector
 marchingcubes.MCVector3 mult(double k)
          performs a multiplication by a scalar
 marchingcubes.MCVector3 normalize()
          makes the vectors length equal to 1
 marchingcubes.MCVector3 sub(double x, double y, double z)
          substracts values to the vectors components
 marchingcubes.MCVector3 sub(marchingcubes.MCVector3 v)
          performs a substraction between two vectors
 java.lang.String toString()
          returns a string representation of the vector
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

protected double x

y

protected double y

z

protected double z
Constructor Detail

MCVector3

public MCVector3()
default contructor of a MCVector3 object


MCVector3

public MCVector3(double x,
                 double y,
                 double z)
contructor of a MCVector3 object

Parameters:
x - x component
y - y component
z - z component

MCVector3

public MCVector3(marchingcubes.MCVector3 v)
copy contructor of a MCVector3 object

Parameters:
v - the vector to be duplicated

MCVector3

public MCVector3(marchingcubes.MCVector4 v)
contructor of a MCVector3 object from a four dimensional vector

Parameters:
v - a four dimensional vector
Method Detail

length

public double length()
returns the length of the vector

Returns:
the length of the vector

normalize

public marchingcubes.MCVector3 normalize()
makes the vectors length equal to 1


add

public marchingcubes.MCVector3 add(marchingcubes.MCVector3 v)
performs an addition between two vectors

Parameters:
v - the vector to add
Returns:
the result of the addition

add

public marchingcubes.MCVector3 add(double x,
                                   double y,
                                   double z)
adds values to the vectors components

Parameters:
x - value to add to the x component
Returns:
the result of the addtion

sub

public marchingcubes.MCVector3 sub(marchingcubes.MCVector3 v)
performs a substraction between two vectors

Parameters:
v - the vector to substract
Returns:
the result of the substraction

sub

public marchingcubes.MCVector3 sub(double x,
                                   double y,
                                   double z)
substracts values to the vectors components

Parameters:
x - value to substract to the x component
Returns:
the result of the substraction

mult

public marchingcubes.MCVector3 mult(double k)
performs a multiplication by a scalar

Parameters:
k - the scalar value to multiply by
Returns:
the result of the multiplication

div

public marchingcubes.MCVector3 div(double k)
performs a division by a scalar

Parameters:
k - the scalar value to divide by
Returns:
the result of the division

dot

public double dot(marchingcubes.MCVector3 v)
compute dot product

Parameters:
v - the vector used for computation
Returns:
the dot product value

cross

public marchingcubes.MCVector3 cross(marchingcubes.MCVector3 v)
compute cross product

Parameters:
v - the vector used for computation
Returns:
the cross product vector

toString

public java.lang.String toString()
returns a string representation of the vector

Overrides:
toString in class java.lang.Object
Returns:
a string representing the vector