pi
Class Vec

Object
  extended by pi.Vec
Direct Known Subclasses:
Vec.Unit

public class Vec
extends Object


Nested Class Summary
static class Vec.Unit
          A vector with length=1
 
Field Summary
static int MAX_Y
           
static int MIN_Y
           
 int x
           
 int y
           
 int z
           
static Vec ZERO
           
 
Method Summary
 Vec add(int x, int y, int z)
          Add
 Vec add(Vec v)
          Add
 int dot(Vec v)
          Scalar product
 boolean equals(Object obj)
           
 int hashCode()
           
 Vec mul(int s)
          Multiply with integer (scale)
 Vec neg()
          Negate (multiply with -1)
 Vec sub(Vec v)
          Subtract
 String toString()
           
static Vec xyz(int x, int y, int z)
          Create
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ZERO

public static final Vec ZERO

MIN_Y

public static final int MIN_Y
See Also:
Constant Field Values

MAX_Y

public static final int MAX_Y
See Also:
Constant Field Values

x

public final int x

y

public final int y

z

public final int z
Method Detail

xyz

public static Vec xyz(int x,
                      int y,
                      int z)
Create


add

public Vec add(Vec v)
Add


add

public Vec add(int x,
               int y,
               int z)
Add


sub

public Vec sub(Vec v)
Subtract


mul

public Vec mul(int s)
Multiply with integer (scale)


neg

public Vec neg()
Negate (multiply with -1)


dot

public int dot(Vec v)
Scalar product


hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public final String toString()
Overrides:
toString in class Object