Class pmr.euclid.Int2
All Packages Class Hierarchy This Package Previous Next Index
Class pmr.euclid.Int2
java.lang.Object
|
+----pmr.euclid.Status
|
+----pmr.euclid.Int2
- public class Int2
- extends Status
Int2 - a pair of integers - no other assumptions
Contains two ints.
The default value is 0, 0.
- Author:
- (C) P. Murray-Rust, 1996
-
Int2()
-
-
Int2(int, int)
-
-
Int2(Int2)
- copy constructor
-
clear()
- set to 0, 0
-
dotProduct(Int2)
- get dot product
-
elementAt(int)
- get either value; counts from ZERO
-
equals(Int2)
-
-
getMidPoint(Int2)
- point midway between 'this' and 'p'
-
getX()
- get X value
-
getY()
- get Y value
-
multiplyBy(int)
- multiply a point by a scalar
-
negative()
- multiply both components by -1; MODIFIES 'this'
-
plus(Int2)
- add two points - vector sum;
-
setX(int)
-
-
setY(int)
-
-
sortAscending()
- sorts x and y so that x <= y
-
sortDescending()
- sorts x and y so that x >= y
-
subtract(Int2)
- subtract two points - vector difference;
-
swap()
- swaps the x and y values
-
toString()
-
Int2
public Int2()
Int2
public Int2(int x,
int y)
Int2
public Int2(Int2 r)
- copy constructor
swap
public void swap()
- swaps the x and y values
sortAscending
public void sortAscending()
- sorts x and y so that x <= y
sortDescending
public void sortDescending()
- sorts x and y so that x >= y
clear
public void clear()
- set to 0, 0
setX
public void setX(int xx)
setY
public void setY(int yy)
equals
public boolean equals(Int2 r)
plus
public Int2 plus(Int2 r2)
- add two points - vector sum;
subtract
public Int2 subtract(Int2 r2)
- subtract two points - vector difference;
negative
public void negative()
- multiply both components by -1; MODIFIES 'this'
multiplyBy
public Int2 multiplyBy(int f)
- multiply a point by a scalar
getX
public int getX()
- get X value
getY
public int getY()
- get Y value
elementAt
public int elementAt(int elem) throws ArrayIndexOutOfBoundsException
- get either value; counts from ZERO
getMidPoint
public Int2 getMidPoint(Int2 p)
- point midway between 'this' and 'p'
dotProduct
public int dotProduct(Int2 r)
- get dot product
toString
public String toString()
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index