|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.colorado.geometry.Location
public class Location
A Location object keeps track of a location on a two-dimensional plane.
| Constructor Summary | |
|---|---|
Location(double xInitial,
double yInitial)
Construct a Location with specified coordinates. |
|
| Method Summary | |
|---|---|
Location |
clone()
Generate a copy of this Location. |
static double |
distance(Location p1,
Location p2)
Compute the distance between two Locations. |
boolean |
equals(java.lang.Object obj)
Compare this Location to another object for equality. |
double |
getX()
Get the x coordinate of this Location. |
double |
getY()
Get the y coordinate of this Location. |
static Location |
midpoint(Location p1,
Location p2)
Generate and return a Location halfway between two others. |
void |
rotate90()
Rotate this Location 90 degrees in a clockwise direction. |
void |
shift(double xAmount,
double yAmount)
Move this Location by given amounts along the x and y axes. |
java.lang.String |
toString()
Generate a String representation of this Location. |
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Location(double xInitial,
double yInitial)
xInitial - the initial x coordinate of this LocationyInitial - the initial y coordinate of this Location| Method Detail |
|---|
public Location clone()
clone in class java.lang.Object- - none
public static double distance(Location p1,
Location p2)
p1 - the first Locationp2 - the second Location
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - an object with which this Location will be compared
public double getX()
- - none
public double getY()
- - none
public static Location midpoint(Location p1,
Location p2)
p1 - the first Locationp2 - the second Location
public void rotate90()
- - none
public void shift(double xAmount,
double yAmount)
xAmount - the amount to move this Location along the x axisyAmount - the amount to move this Location along the y axispublic java.lang.String toString()
toString in class java.lang.Object- - none
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||