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)
           
 int 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 length()
          Interpreting this Tuple2i as a fixed-point vector, return its length.
 int lengthSquared()
          Interpreting this Tuple2i as a fixed-point vector, return the square of 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, hashCode, 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

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)

lengthSquared

public int lengthSquared()
Interpreting this Tuple2i as a fixed-point vector, return the square of its length.


length

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


dot

public int 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-2008 Interactive Pulp, LLC.