All Packages Class Hierarchy This Package Previous Next Index
Class tw.edu.ncnu.im.cnclab.Tools.MathIntVector
java.lang.Object
|
+----tw.edu.ncnu.im.cnclab.Tools.MathIntVector
- public class MathIntVector
- extends Object
- implements Cloneable
The MathIntVector class provides methods for geometric
problem to deal with integer coordinates. Usually be used to draw
lines at java.awt.Canvas
It is useful while:
- Invert the direction of the vector.
- Getting the perpendicular of specified vectors/lines.
- Modified the length of specified vector.
- Version:
- 0.4 Jul 8, 1999
- Author:
- Ding-Yi Chen
-
x
-
-
y
-
-
MathIntVector(int, int)
- Constructor of the MathIntVector.
-
clone()
- Returns a clone of this MathIntVector.
-
getLength()
- Get the length of this vector.
-
negative()
- Invert the direction of this vector.
-
perpendicular()
- Rotatae this vertor 90 degree conterclockwise.
-
setLength(double)
- Set the length of this vector.
x
public int x
y
public int y
MathIntVector
public MathIntVector(int x,
int y)
- Constructor of the MathIntVector.
- Parameters:
- x - The coordinate x.
- y - The coordinate y.
clone
public Object clone()
- Returns a clone of this MathIntVector.
- Returns:
- a dclone of this MathIntVector.
- Overrides:
- clone in class Object
negative
public void negative()
- Invert the direction of this vector.
perpendicular
public void perpendicular()
- Rotatae this vertor 90 degree conterclockwise.
getLength
public double getLength()
- Get the length of this vector.
- Returns:
- The length of this vector.
setLength
public void setLength(double newLength)
- Set the length of this vector.
- Parameters:
- newLength - The new length of this vector.
All Packages Class Hierarchy This Package Previous Next Index