@Reference(authors="Ed Williams", title="Aviation Formulary", booktitle="", url="http://williams.best.vwh.net/avform.htm") public final class GeoUtil extends Object
Ed Williams
Aviation Formulary
Online: http://williams.best.vwh.net/avform.htm
Modifier and Type | Field and Description |
---|---|
static double |
EARTH_RADIUS
Earth radius approximation in km.
|
static double |
WGS84_ECCENTRICITY_SQUARED
Eccentricity squared of the WGS84 Ellipsoid
|
static double |
WGS84_FLATTENING
Flattening of the WGS84 Ellipsoid.
|
static double |
WGS84_RADIUS
Radius of the WGS84 Ellipsoid in km.
|
Modifier | Constructor and Description |
---|---|
private |
GeoUtil()
Dummy constructor.
|
Modifier and Type | Method and Description |
---|---|
static double |
alongTrackDistance(double lat1,
double lon1,
double lat2,
double lon2,
double latQ,
double lonQ)
The along track distance, is the distance from S to Q along the track S to
E.
|
static double |
alongTrackDistance(double lat1,
double lon1,
double lat2,
double lon2,
double latQ,
double lonQ,
double dist1Q,
double ctd)
The along track distance, is the distance from S to Q along the track S to
E.
|
static double |
bearing(double latS,
double lngS,
double latE,
double lngE)
Compute the bearing from start to end.
|
static double |
crossTrackDistance(double lat1,
double lon1,
double lat2,
double lon2,
double latQ,
double lonQ)
Compute the cross-track distance.
|
static double |
crossTrackDistanceDeg(double lat1,
double lon1,
double lat2,
double lon2,
double latQ,
double lonQ,
double dist1Q)
Compute the cross-track distance.
|
static double |
crossTrackDistanceRad(double lat1,
double lon1,
double lat2,
double lon2,
double latQ,
double lonQ)
Compute the cross-track distance.
|
static double |
crossTrackDistanceRad(double lat1,
double lon1,
double lat2,
double lon2,
double latQ,
double lonQ,
double dist1Q)
Compute the cross-track distance.
|
static double |
haversineFormulaDeg(double lat1,
double lon1,
double lat2,
double lon2)
Compute the approximate on-earth-surface distance of two points using the
Haversine formula
Complexity: 5 trigonometric functions, 2 sqrt.
|
static double |
haversineFormulaRad(double lat1,
double lon1,
double lat2,
double lon2)
Compute the approximate on-earth-surface distance of two points using the
Haversine formula
Complexity: 5 trigonometric functions, 2 sqrt.
|
static double[] |
latLngDegToXZY(double lat,
double lng)
Convert Latitude-Longitude pair to X-Y-Z coordinates using a spherical
approximation of the earth.
|
static double[] |
latLngDegToXZYWGS84(double lat,
double lng)
Map a latitude,longitude pair to 3D X-Y-Z coordinates, using athe WGS84
ellipsoid.
|
static double |
latlngMinDistDeg(double plat,
double plng,
double rminlat,
double rminlng,
double rmaxlat,
double rmaxlng)
Point to rectangle minimum distance.
|
static double |
latlngMinDistRad(double plat,
double plng,
double rminlat,
double rminlng,
double rmaxlat,
double rmaxlng)
Point to rectangle minimum distance.
|
static double |
sphericalVincentyFormulaDeg(double lat1,
double lon1,
double lat2,
double lon2)
Compute the approximate on-earth-surface distance of two points.
|
static double |
sphericalVincentyFormulaRad(double lat1,
double lon1,
double lat2,
double lon2)
Compute the approximate on-earth-surface distance of two points.
|
static double |
xyzToLatDeg(double z)
Convert a 3D coordinate pair to the corresponding latitude.
|
static double |
xyzToLatDegWGS84(double x,
double y,
double z)
Convert a 3D coordinate pair to the corresponding longitude.
|
static double |
xyzToLngDeg(double x,
double y)
Convert a 3D coordinate pair to the corresponding longitude.
|
public static final double EARTH_RADIUS
public static final double WGS84_RADIUS
public static final double WGS84_FLATTENING
public static final double WGS84_ECCENTRICITY_SQUARED
@Reference(authors="Sinnott, R. W.", title="Virtues of the Haversine", booktitle="Sky and telescope, 68-2, 1984") public static double haversineFormulaDeg(double lat1, double lon1, double lat2, double lon2)
R. W. Sinnott,
Virtues of the Haversine
Sky and telescope, 68-2, 1984
lat1
- Latitude of first point in degreelon1
- Longitude of first point in degreelat2
- Latitude of second point in degreelon2
- Longitude of second point in degree@Reference(authors="Sinnott, R. W.", title="Virtues of the Haversine", booktitle="Sky and telescope, 68-2, 1984") public static double haversineFormulaRad(double lat1, double lon1, double lat2, double lon2)
R. W. Sinnott,
Virtues of the Haversine
Sky and telescope, 68-2, 1984
lat1
- Latitude of first point in degreelon1
- Longitude of first point in degreelat2
- Latitude of second point in degreelon2
- Longitude of second point in degree@Reference(authors="T. Vincenty", title="Direct and inverse solutions of geodesics on the ellipsoid with application of nested equations", booktitle="Survey review 23 176, 1975", url="http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf") public static double sphericalVincentyFormulaDeg(double lat1, double lon1, double lat2, double lon2)
T. Vincenty
Direct and inverse solutions of geodesics on the ellipsoid with application
of nested equations
Survey review 23 176, 1975
lat1
- Latitude of first point in degreelon1
- Longitude of first point in degreelat2
- Latitude of second point in degreelon2
- Longitude of second point in degree@Reference(authors="T. Vincenty", title="Direct and inverse solutions of geodesics on the ellipsoid with application of nested equations", booktitle="Survey review 23 176, 1975", url="http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf") public static double sphericalVincentyFormulaRad(double lat1, double lon1, double lat2, double lon2)
T. Vincenty
Direct and inverse solutions of geodesics on the ellipsoid with application
of nested equations
Survey review 23 176, 1975
lat1
- Latitude of first point in degreelon1
- Longitude of first point in degreelat2
- Latitude of second point in degreelon2
- Longitude of second point in degreepublic static double crossTrackDistanceDeg(double lat1, double lon1, double lat2, double lon2, double latQ, double lonQ, double dist1Q)
lat1
- Latitude of starting point.lon1
- Longitude of starting point.lat2
- Latitude of destination point.lon2
- Longitude of destination point.latQ
- Latitude of query point.lonQ
- Longitude of query point.dist1Q
- Distance from starting point to query point in km.public static double crossTrackDistanceRad(double lat1, double lon1, double lat2, double lon2, double latQ, double lonQ, double dist1Q)
lat1
- Latitude of starting point.lon1
- Longitude of starting point.lat2
- Latitude of destination point.lon2
- Longitude of destination point.latQ
- Latitude of query point.lonQ
- Longitude of query point.dist1Q
- Distance from starting point to query point in km.public static double crossTrackDistance(double lat1, double lon1, double lat2, double lon2, double latQ, double lonQ)
lat1
- Latitude of starting point.lon1
- Longitude of starting point.lat2
- Latitude of destination point.lon2
- Longitude of destination point.latQ
- Latitude of query point.lonQ
- Longitude of query point.public static double crossTrackDistanceRad(double lat1, double lon1, double lat2, double lon2, double latQ, double lonQ)
lat1
- Latitude of starting point.lon1
- Longitude of starting point.lat2
- Latitude of destination point.lon2
- Longitude of destination point.latQ
- Latitude of query point.lonQ
- Longitude of query point.public static double alongTrackDistance(double lat1, double lon1, double lat2, double lon2, double latQ, double lonQ)
lat1
- Latitude of starting point.lon1
- Longitude of starting point.lat2
- Latitude of destination point.lon2
- Longitude of destination point.latQ
- Latitude of query point.lonQ
- Longitude of query point.public static double alongTrackDistance(double lat1, double lon1, double lat2, double lon2, double latQ, double lonQ, double dist1Q, double ctd)
lat1
- Latitude of starting point.lon1
- Longitude of starting point.lat2
- Latitude of destination point.lon2
- Longitude of destination point.latQ
- Latitude of query point.lonQ
- Longitude of query point.dist1Q
- Distance S to Qctd
- Cross-track-distancepublic static double latlngMinDistDeg(double plat, double plng, double rminlat, double rminlng, double rmaxlat, double rmaxlng)
plat
- Latitude of query point.plng
- Longitude of query point.rminlat
- Min latitude of rectangle.rminlng
- Min longitude of rectangle.rmaxlat
- Max latitude of rectangle.rmaxlng
- Max longitude of rectangle.public static double latlngMinDistRad(double plat, double plng, double rminlat, double rminlng, double rmaxlat, double rmaxlng)
plat
- Latitude of query point.plng
- Longitude of query point.rminlat
- Min latitude of rectangle.rminlng
- Min longitude of rectangle.rmaxlat
- Max latitude of rectangle.rmaxlng
- Max longitude of rectangle.public static double bearing(double latS, double lngS, double latE, double lngE)
latS
- Start latitude, in degreelngS
- Start longitude, in degreelatE
- End latitude, in degreelngE
- End longitude, in degreepublic static double[] latLngDegToXZYWGS84(double lat, double lng)
lat
- Latitude in degreelng
- Longitude in degreepublic static double[] latLngDegToXZY(double lat, double lng)
lat
- Latitude in degreelng
- Longitude in degreepublic static double xyzToLatDegWGS84(double x, double y, double z)
x
- X valuey
- Y valuepublic static double xyzToLatDeg(double z)
z
- Z valuepublic static double xyzToLngDeg(double x, double y)
x
- X valuey
- Y value