|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--Point
The Point class represents a 2D point
| Field Summary | |
private static double |
DEFAULT_X
default x position of point |
private static double |
DEFAULT_Y
default y position of point |
private double |
x
x position of point |
private double |
y
y position of point |
| Constructor Summary | |
Point()
construtor to create a Point object with the default position |
|
Point(double xc,
double yc)
constructor to create and initialise a Point object |
|
| Method Summary | |
static double |
distBetween(Point p1,
Point p2)
calculates the distance between two Point objects |
boolean |
equals(Point p)
tests whether two Point objects are at the same position |
void |
moveTo(double xc,
double yc)
moves the Point to a new position |
void |
moveTo(Point p)
moves the Point to a new position |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private double x
private double y
private static final double DEFAULT_X
private static final double DEFAULT_Y
| Constructor Detail |
public Point(double xc,
double yc)
xc - the initial x-axis positionyc - the initial y-axis positionpublic Point()
| Method Detail |
public boolean equals(Point p)
p - the Point object to be compared to
public void moveTo(double xc,
double yc)
xc - the new x-axis positionyc - the new y-axis positionpublic void moveTo(Point p)
p - the position to move to
public static double distBetween(Point p1,
Point p2)
p1 - the first positionp2 - the second position
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||