coordinates
Class Cartesian

java.lang.Object
  extended bycoordinates.Cartesian

public class Cartesian
extends java.lang.Object

Cartesian coordinates. A cartesian coordinate is nothing but a vector with three dimensions. There is no origin. It must be clear from the context where the vector is used in. The absolut real life distance per grid is a config value.


Constructor Summary
Cartesian(int x, int y, int z)
           
 
Method Summary
 int compareTo(Cartesian with)
          Compare two Cartesian vectors.
 int getX()
           
 int getY()
           
 int getZ()
           
 void move(Cartesian distance)
          Add two vectors
 void setX(int x)
           
 void setY(int y)
           
 void setZ(int z)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cartesian

public Cartesian(int x,
                 int y,
                 int z)
Method Detail

getX

public int getX()

getY

public int getY()

getZ

public int getZ()

setX

public void setX(int x)

setY

public void setY(int y)

setZ

public void setZ(int z)

move

public void move(Cartesian distance)
Add two vectors


compareTo

public int compareTo(Cartesian with)
Compare two Cartesian vectors. In this comparison a vector is greater than an other if and only if alls three components are greater. If neither vector is greater the vectors are considered as equal.

Parameters:
with - the vector to compare with
Returns:
1 if this > with, -1 if this < with, 0 else