|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.monarchy.guideme.util.GeoCoordinate
public class GeoCoordinate
GeoCoordinate represents a location on a globe, represented by latitude and longitude. Latitude is measured in degrees from -90 to 90, with 0 being at the equator and positive values representing positions on the northern hemisphere, negative values positions on the southern. Longitude is measured in degrees from -180 to 180 with 0 being the prime meridian and negative values being west of it, positive in the east.
Field Summary | |
---|---|
static double |
DEG_TO_RAD
conversion of degrees to radian |
static double |
EARTH_RADIUS
earth radius in meters |
static double |
RAD_TO_DEG
conversion of radian to degrees |
Constructor Summary | |
---|---|
GeoCoordinate(double lat,
double lon)
Creates a geo coordinate representing the position at lat, lon |
|
GeoCoordinate(GeoCoordinate copy)
Copies the values of the given coordinate to the new one. |
Method Summary | |
---|---|
double |
distanceTo(GeoCoordinate another)
Returns the distance between to points on the unit sphere. |
boolean |
equals(java.lang.Object o)
|
double |
getLatitude()
Returns the latitude. |
double |
getLongitude()
Returns the longitude. |
int |
hashCode()
|
void |
setLatitude(double latitude)
Sets the latitude. |
void |
setLongitude(double longitude)
Sets the longitude. |
java.lang.String |
toString()
|
double |
trackAngle(GeoCoordinate another)
Returns the angle a given point lies in relation to this. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final double EARTH_RADIUS
public static final double DEG_TO_RAD
public static final double RAD_TO_DEG
Constructor Detail |
---|
public GeoCoordinate(double lat, double lon)
lat
- latitudelon
- longitudepublic GeoCoordinate(GeoCoordinate copy)
copy
- coordinate to be copiedMethod Detail |
---|
public double getLongitude()
public void setLongitude(double longitude)
longitude
- new longitude
java.lang.IllegalArgumentException
- if values unfittingpublic double getLatitude()
public void setLatitude(double latitude)
latitude
- new latitude
java.lang.IllegalArgumentException
- if values unfittingpublic double distanceTo(GeoCoordinate another)
another
- other point the distance is calculated to
public double trackAngle(GeoCoordinate another)
another
- other point whose direction is needed
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |