|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--geography.Point
A point on the surface of the earth. Represented by a longitude and a latitude. We always write the longitude first, since (longitude,latitude) is rather like (x,y). These measurements are in degrees, not radians.
| Field Summary | |
protected static double |
GLOBE_RADIUS_EQUATOR
Radius of the earth, in meters, at the equator. |
protected static double |
GLOBE_RADIUS_POLES
Radius of the earth, in meters, at the poles. |
protected double |
latitude
Latitude of this point, in degrees. |
protected double |
longitude
Longitude of this point, in degrees. |
| Constructor Summary | |
Point(double longitude,
double latitude)
|
|
Point(java.lang.String longitude,
java.lang.String latitude)
|
|
| Method Summary | |
protected static double |
degrees(double radians)
|
double |
directionTo(geography.Point p)
The direction that you have to go from this point to get to p. |
double |
distanceTo(geography.Point p)
Distance from this point to another point, using the Haversine formula. |
boolean |
equals(java.lang.Object p)
|
protected static double |
globeRadiusOfCurvature(double lat)
Computes the earth's radius of curvature at a particular latitude, assuming that the earth is a squashed sphere with elliptical cross-section. |
int |
hashCode()
|
static void |
main(java.lang.String[] args)
|
protected static double |
radians(double degrees)
|
protected static double |
square(double d)
|
static void |
test(double long1,
double lat1,
double long2,
double lat2)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected static final double GLOBE_RADIUS_EQUATOR
protected static final double GLOBE_RADIUS_POLES
protected double longitude
protected double latitude
| Constructor Detail |
public Point(double longitude,
double latitude)
public Point(java.lang.String longitude,
java.lang.String latitude)
throws java.lang.NumberFormatException
| Method Detail |
public boolean equals(java.lang.Object p)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic double distanceTo(geography.Point p)
public double directionTo(geography.Point p)
protected static final double radians(double degrees)
protected static final double degrees(double radians)
protected static final double square(double d)
protected static final double globeRadiusOfCurvature(double lat)
lat - - latitude in radians. This is the angle
that a point at this latitude makes with the horizontal.
public static void test(double long1,
double lat1,
double long2,
double lat2)
public static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||