net.sourceforge.arbaro.transformation
Class Vector

java.lang.Object
  extended by net.sourceforge.arbaro.transformation.Vector

public final class Vector
extends java.lang.Object

A x,y,z-vector class

Author:
Wolfram Diestel

Field Summary
static Vector X_AXIS
           
static Vector Y_AXIS
           
static Vector Z_AXIS
           
 
Constructor Summary
Vector()
           
Vector(double x, double y, double z)
           
 
Method Summary
 double abs()
           
 Vector add(Vector v)
           
static double atan2(double v, double u)
          Returns the angle of a 2-dimensional vector (u,v) with the u-axis
 Vector div(double factor)
           
 boolean equals(Vector v)
           
 double getX()
           
 double getY()
           
 double getZ()
           
 Vector mul(double factor)
           
 Vector normalize()
           
 double prod(Vector v)
           
 void setMaxCoord(Vector v)
           
 void setMinCoord(Vector v)
           
 Vector sub(Vector v)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

X_AXIS

public static final Vector X_AXIS

Y_AXIS

public static final Vector Y_AXIS

Z_AXIS

public static final Vector Z_AXIS
Constructor Detail

Vector

public Vector()

Vector

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

equals

public boolean equals(Vector v)

abs

public double abs()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

normalize

public Vector normalize()

getX

public double getX()

getY

public double getY()

getZ

public double getZ()

mul

public Vector mul(double factor)

prod

public double prod(Vector v)

div

public Vector div(double factor)

add

public Vector add(Vector v)

sub

public Vector sub(Vector v)

atan2

public static double atan2(double v,
                           double u)
Returns the angle of a 2-dimensional vector (u,v) with the u-axis

Parameters:
v - v-coordinate of the vector
u - u-coordinate of the vector
Returns:
a value from (-180..180)

setMaxCoord

public void setMaxCoord(Vector v)

setMinCoord

public void setMinCoord(Vector v)