|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Point
This class defines points on a standard Cartesian (XY) plane.
Constructor Summary | |
Point()
Create a point at the origin (x = y = 0). |
|
Point(double x,
double y)
Create a point at the specified coordinate. |
Method Summary | |
double |
distanceFrom(Point p)
Determine the distance between two points |
double |
distanceFromOrigin()
Determine the distance between the origin and the point. |
double |
getX()
Retrieve the X coordinate of the point. |
double |
getY()
Retrieve the Y coordinate of the point. |
void |
setX(double x)
Change the X coordinate of the point. |
void |
setY(double y)
Change the Y coordinate of the point. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Point()
public Point(double x, double y)
x
- The X coordinatey
- The Y coordinateMethod Detail |
public void setX(double x)
x
- The new X coordinatepublic void setY(double y)
y
- The new Y coordinatepublic double getX()
public double getY()
public double distanceFromOrigin()
public double distanceFrom(Point p)
p
- The point to determine the distance from
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |