PulpCore

pulpcore.math
Class Tuple2i

java.lang.Object
  extended by pulpcore.math.Tuple2i

public class Tuple2i
extends Object

An integer pair that can be used as a point, vector, dimension, complex, etc.


Field Summary
 int x
           
 int y
           
 
Constructor Summary
Tuple2i()
           
Tuple2i(int x, int y)
           
Tuple2i(Tuple2i t)
           
 
Method Summary
 void add(int x, int y)
           
 void add(Tuple2i t)
           
 long dot(Tuple2i t)
          Interpreting this Tuple2i and the specified Tuple2i as a fixed-point vector, return the dot product of the two vectors.
 boolean equals(Object o)
           
 int hashCode()
           
 long length()
          Interpreting this Tuple2i as a fixed-point vector, return its length.
 void set(int x, int y)
           
 void sub(int x, int y)
           
 void sub(Tuple2i t)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

public int x

y

public int y
Constructor Detail

Tuple2i

public Tuple2i()

Tuple2i

public Tuple2i(int x,
               int y)

Tuple2i

public Tuple2i(Tuple2i t)
Method Detail

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

set

public void set(int x,
                int y)

add

public void add(int x,
                int y)

sub

public void sub(int x,
                int y)

add

public void add(Tuple2i t)

sub

public void sub(Tuple2i t)

length

public long length()
Interpreting this Tuple2i as a fixed-point vector, return its length.


dot

public long dot(Tuple2i t)
Interpreting this Tuple2i and the specified Tuple2i as a fixed-point vector, return the dot product of the two vectors.


PulpCore

Copyright © 2007-2009 Interactive Pulp, LLC.