public class DistancePlaneProjection extends DistanceCalcEarth
http://en.wikipedia.org/wiki/Geographical_distance#Spherical_Earth_projected_to_a_plane
http://stackoverflow.com/q/1006654
http://en.wikipedia.org/wiki/Mercator_projection#Mathematics_of_the_Mercator_projection http://gis.stackexchange.com/questions/4906/why-is-law-of-cosines-more-preferable-than-haversine-when-calculating-distance-b
| Modifier and Type | Field and Description |
|---|---|
static DistancePlaneProjection |
DIST_PLANE |
C, DIST_EARTH, KM_MILE, METERS_PER_DEGREE, R, R_EQ| Constructor and Description |
|---|
DistancePlaneProjection() |
| Modifier and Type | Method and Description |
|---|---|
double |
calcDenormalizedDist(double normedDist)
Inverse to calcNormalizedDist.
|
double |
calcDist(double fromLat,
double fromLon,
double toLat,
double toLon)
Calculates distance of (from, to) in meter.
|
double |
calcDist3D(double fromLat,
double fromLon,
double fromHeight,
double toLat,
double toLon,
double toHeight)
This implements a rather quick solution to calculate 3D distances on earth using euclidean
geometry mixed with Haversine formula used for the on earth distance.
|
double |
calcNormalizedDist(double dist)
Returns the specified length in normalized meter.
|
double |
calcNormalizedDist(double fromLat,
double fromLon,
double toLat,
double toLon)
Calculates in normalized meter
|
String |
toString() |
calcCircumference, calcCrossingPointToEdge, calcDistance, calcDistance, calcNormalizedEdgeDistance, calcNormalizedEdgeDistance3D, createBBox, hasElevationDiff, intermediatePoint, isCrossBoundary, isDateLineCrossOver, projectCoordinate, validEdgeDistancepublic static final DistancePlaneProjection DIST_PLANE
public double calcDist(double fromLat,
double fromLon,
double toLat,
double toLon)
DistanceCalcEarthhttp://en.wikipedia.org/wiki/Haversine_formula a = sin²(Δlat/2) + cos(lat1).cos(lat2).sin²(Δlong/2) c = 2.atan2(√a, √(1−a)) d = R.c
calcDist in interface DistanceCalccalcDist in class DistanceCalcEarthpublic double calcDist3D(double fromLat,
double fromLon,
double fromHeight,
double toLat,
double toLon,
double toHeight)
DistanceCalcEarthcalcDist3D in interface DistanceCalccalcDist3D in class DistanceCalcEarthpublic double calcDenormalizedDist(double normedDist)
DistanceCalccalcDenormalizedDist in interface DistanceCalccalcDenormalizedDist in class DistanceCalcEarthpublic double calcNormalizedDist(double dist)
DistanceCalcEarthcalcNormalizedDist in interface DistanceCalccalcNormalizedDist in class DistanceCalcEarthpublic double calcNormalizedDist(double fromLat,
double fromLon,
double toLat,
double toLon)
DistanceCalccalcNormalizedDist in interface DistanceCalccalcNormalizedDist in class DistanceCalcEarthpublic String toString()
toString in class DistanceCalcEarthCopyright © 2012–2022. All rights reserved.