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:

Version:
0.4 Jul 8, 1999
Author:
Ding-Yi Chen

Variable Index

 o x
 o y

Constructor Index

 o MathIntVector(int, int)
Constructor of the MathIntVector.

Method Index

 o clone()
Returns a clone of this MathIntVector.
 o getLength()
Get the length of this vector.
 o negative()
Invert the direction of this vector.
 o perpendicular()
Rotatae this vertor 90 degree conterclockwise.
 o setLength(double)
Set the length of this vector.

Variables

 o x
 public int x
 o y
 public int y

Constructors

 o MathIntVector
 public MathIntVector(int x,
                      int y)
Constructor of the MathIntVector.

Parameters:
x - The coordinate x.
y - The coordinate y.

Methods

 o clone
 public Object clone()
Returns a clone of this MathIntVector.

Returns:
a dclone of this MathIntVector.
Overrides:
clone in class Object
 o negative
 public void negative()
Invert the direction of this vector.

 o perpendicular
 public void perpendicular()
Rotatae this vertor 90 degree conterclockwise.

 o getLength
 public double getLength()
Get the length of this vector.

Returns:
The length of this vector.
 o 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