|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bbn.openmap.geo.Geo
This is a Ken Anderson class for dealing with geographical coordinates.
A class that represents a point on the Earth as a three dimensional
unit length vector, rather than latitude and longitude. For the
theory and an efficient implementation using partial evaluation
see:
http://openmap.bbn.com/~kanderso/lisp/performing-lisp/essence.ps
This implementation matches the theory carefully, but does not use partial evaluation.
For the area calculation see: http://math.rice.edu/~pcmi/sphere/
Field Summary | |
static double |
f
|
static double |
flattening
Constants for the shape of the earth. |
static Geo |
north
North pole. |
Constructor Summary | |
Geo(double lat,
double lon)
Construct a Geo from its latitude and longitude. |
|
Geo(double x,
double y,
double z)
Construct a Geo from its parts. |
Method Summary | |
Geo |
add(Geo b)
Returns this + b. |
static double |
angle(Geo p0,
Geo p1,
Geo p2)
Given 3 points on a sphere, p0, p1, p2, return the angle between them in radians. |
Geo |
antipode()
Returns the point opposite this point on the earth. |
static double |
area(java.util.Enumeration vs)
Computes the area of a polygon on the surface of a unit sphere given an enumeration of its point. |
double |
azimuth(Geo v2)
Azimuth in radians from this to v2. |
static Geo |
createGeo(double rlatR,
double rlon)
Construct a Geo from its latitude and longitude in radians. |
Geo |
cross(Geo b)
Vector cross product. |
double |
crossLength(Geo b)
Equivalent to this.cross(b).length(). |
Geo |
crossNormalize(Geo b)
Equivalent to this.cross(b).normalize(). |
static Geo |
crossNormalize(Geo a,
Geo b)
Eqvivalent to this.cross(b).normalize(). |
static double |
degrees(double radians)
Convert from radians to degrees. |
static double |
distance(double lat1,
double lon1,
double lat2,
double lon2)
Angular distance, in radians between the two lat lon points. |
double |
distance(Geo v2)
Angular distance, in radians between this and v2. |
static double |
distance(Geo v1,
Geo v2)
Angular distance, in radians between v1 and v2. |
static double |
distanceKM(double lat1,
double lon1,
double lat2,
double lon2)
Distance in kilometers. |
double |
distanceKM(Geo v2)
Distance in kilometers. |
static double |
distanceKM(Geo v1,
Geo v2)
Distance in kilometers. |
static double |
distanceNM(double lat1,
double lon1,
double lat2,
double lon2)
Distance in nautical miles. |
double |
distanceNM(Geo v2)
Distance in nautical miles. |
static double |
distanceNM(Geo v1,
Geo v2)
Distance in nautical miles. |
double |
dot(Geo b)
Dot product. |
static double |
dot(Geo a,
Geo b)
Dot product. |
static double |
geocentricLatitude(double geographicLatitude)
Convert from geographic to geocentric latitude (radians). |
static double |
geographicLatitude(double geocentricLatitude)
Convert from geocentric to geographic latitude (radians) |
double |
getLatitude()
|
double |
getLongitude()
|
boolean |
inBubble(Geo v2,
double forwardRadius,
double backRadius,
Geo p)
Is Geo p inside the time bubble along the great circle segment from this to v2 looking forward forwardRadius and backward backwardRadius. |
Geo |
interpolate(Geo g2,
double x)
|
Geo |
intersect(Geo q,
Geo r)
Find the intersection of the great circle between this and q and the great circle normal to r. |
static boolean |
isInside(double lat1,
double lon1,
double lat2,
double lon2,
double radius,
double lat3,
double lon3)
Static versions using conventional coordinates. |
boolean |
isInside(Geo v2,
double radius,
Geo p)
Is the point, p, within radius radians of the great circle segment between this and v2? |
static double |
km(double radians)
Convert radians to kilometers. |
static double |
kmToAngle(double km)
Convert kilometers to radians. |
double |
length()
Euclidian length. |
Geo |
midPoint(Geo g2)
|
static double |
nm(double radians)
Convert radians to nauticalMiles. |
static double |
nmToAngle(double nm)
Convert nautical miles to radians. |
Geo |
normalize()
Returns a unit length vector parallel to this. |
static double |
radians(double degrees)
Convert from degrees to radians. |
Geo |
scale(double s)
Multiply this by s. |
Geo |
subtract(Geo b)
Returns this - b. |
java.lang.String |
toString()
|
double |
x()
|
double |
y()
|
double |
z()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final double flattening
public static final double f
public static Geo north
Constructor Detail |
public Geo(double lat, double lon)
public Geo(double x, double y, double z)
Method Detail |
public static double geocentricLatitude(double geographicLatitude)
public static double geographicLatitude(double geocentricLatitude)
public static double radians(double degrees)
public static double degrees(double radians)
public static double km(double radians)
public static double kmToAngle(double km)
public static double nm(double radians)
public static double nmToAngle(double nm)
public static Geo createGeo(double rlatR, double rlon)
public Geo midPoint(Geo g2)
public Geo interpolate(Geo g2, double x)
public java.lang.String toString()
toString
in class java.lang.Object
public double getLatitude()
public double getLongitude()
public double x()
public double y()
public double z()
public double dot(Geo b)
public static double dot(Geo a, Geo b)
public double length()
public Geo scale(double s)
public Geo normalize()
public Geo cross(Geo b)
public double crossLength(Geo b)
public Geo crossNormalize(Geo b)
public static Geo crossNormalize(Geo a, Geo b)
public Geo add(Geo b)
public Geo subtract(Geo b)
public double distance(Geo v2)
public static double distance(Geo v1, Geo v2)
public static double distance(double lat1, double lon1, double lat2, double lon2)
public double distanceKM(Geo v2)
public static double distanceKM(Geo v1, Geo v2)
public static double distanceKM(double lat1, double lon1, double lat2, double lon2)
public double distanceNM(Geo v2)
public static double distanceNM(Geo v1, Geo v2)
public static double distanceNM(double lat1, double lon1, double lat2, double lon2)
public double azimuth(Geo v2)
public static double angle(Geo p0, Geo p1, Geo p2)
public static double area(java.util.Enumeration vs)
vs
- an Enumeration of Geos marking the polygon.public boolean isInside(Geo v2, double radius, Geo p)
v2
- Geo marking the center of the area to test.radius
- great circle length of segment to test for p's
distance away from v2. In radians.p
- Geo marking the test point.public static boolean isInside(double lat1, double lon1, double lat2, double lon2, double radius, double lat3, double lon3)
public boolean inBubble(Geo v2, double forwardRadius, double backRadius, Geo p)
public Geo antipode()
public Geo intersect(Geo q, Geo r)
That is, find the point y lying between this and q such that
y = x*this + (1-x)*q y.dot(r) = 0 [x*this + (1-x)*q].dot(r) = 0 x*this.dot(r) + (1-x)*q.dot(r) = 0 x*a + (1-x)*b = 0 x = -b/(a - b)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |