geometry
Class J3Vector

java.lang.Object
  extended by geometry.J3Vector
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
J3Line, J3UnitVector

public class J3Vector
extends java.lang.Object
implements java.io.Serializable


  This class provides a base to represent/handle three vector.

See Also:
Serialized Form

Constructor Summary
J3Vector()
          Constructor.
J3Vector(double x, double y, double z)
          Constructor.
 
Method Summary
static J3Vector add(J3Vector a, J3Vector b)
          add vectors a+b
 void decrement(J3Vector a, J3Vector b)
          decrement vectors a-=b
static double getAngleInDegree(J3Vector a, J3Vector b)
          calculate the angle [deg] between two vectors.
static double getAngleInRadian(J3Vector a, J3Vector b)
          calculate the angle [rad] between two vectors.
static J3Vector getCrossProduct(J3Vector a, J3Vector b)
          calculate the cross Products axb
static double getDotProduct(J3Vector a, J3Vector b)
          calculate the dot-product
 double getLength()
          get the vector length
 double getX()
          get x component
 double getY()
          get y component
 double getZ()
          get z component
 void increment(J3Vector a, J3Vector b)
          increment vectors a+=b
static J3Vector multipleFactor(double f, J3Vector a)
          calculate scalor x vector fxa
 void putVector(J3Vector a)
          put a new vector a = b
 void setAll(double x, double y, double z)
          set all xyz components
 void setLength()
          calculate the vector length to set
 void setX(double x)
          set x component
 void setY(double y)
          set y component
 void setZ(double z)
          set z component
static J3Vector subtract(J3Vector a, J3Vector b)
          sabtract vectors a-b
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

J3Vector

public J3Vector(double x,
                double y,
                double z)
Constructor. For XYZ coordinate system.


J3Vector

public J3Vector()
Constructor. Default setting: x=y=0, z=1.0

Method Detail

setX

public void setX(double x)
set x component


setY

public void setY(double y)
set y component


setZ

public void setZ(double z)
set z component


setAll

public void setAll(double x,
                   double y,
                   double z)
set all xyz components


putVector

public void putVector(J3Vector a)
put a new vector a = b


getX

public double getX()
get x component


getY

public double getY()
get y component


getZ

public double getZ()
get z component


setLength

public void setLength()
calculate the vector length to set


getLength

public double getLength()
get the vector length


getDotProduct

public static double getDotProduct(J3Vector a,
                                   J3Vector b)
calculate the dot-product


getAngleInRadian

public static double getAngleInRadian(J3Vector a,
                                      J3Vector b)
calculate the angle [rad] between two vectors. Return 0 if either of the two vectors is 0.


getAngleInDegree

public static double getAngleInDegree(J3Vector a,
                                      J3Vector b)
calculate the angle [deg] between two vectors. Return 0 if either of the two vectors is 0.


add

public static J3Vector add(J3Vector a,
                           J3Vector b)
add vectors a+b


subtract

public static J3Vector subtract(J3Vector a,
                                J3Vector b)
sabtract vectors a-b


increment

public void increment(J3Vector a,
                      J3Vector b)
increment vectors a+=b


decrement

public void decrement(J3Vector a,
                      J3Vector b)
decrement vectors a-=b


getCrossProduct

public static J3Vector getCrossProduct(J3Vector a,
                                       J3Vector b)
calculate the cross Products axb


multipleFactor

public static J3Vector multipleFactor(double f,
                                      J3Vector a)
calculate scalor x vector fxa