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
C, 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, calcNormalizedEdgeDistance, calcNormalizedEdgeDistance3D, calcNormalizedEdgeDistanceNew, createBBox, hasElevationDiff, isCrossBoundary, isDateLineCrossOver, projectCoordinate, validEdgeDistance
public double calcDist(double fromLat, double fromLon, double toLat, double toLon)
DistanceCalcEarth
http://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 DistanceCalc
calcDist
in class DistanceCalcEarth
public double calcDist3D(double fromLat, double fromLon, double fromHeight, double toLat, double toLon, double toHeight)
DistanceCalcEarth
calcDist3D
in interface DistanceCalc
calcDist3D
in class DistanceCalcEarth
public double calcDenormalizedDist(double normedDist)
DistanceCalc
calcDenormalizedDist
in interface DistanceCalc
calcDenormalizedDist
in class DistanceCalcEarth
public double calcNormalizedDist(double dist)
DistanceCalcEarth
calcNormalizedDist
in interface DistanceCalc
calcNormalizedDist
in class DistanceCalcEarth
public double calcNormalizedDist(double fromLat, double fromLon, double toLat, double toLon)
DistanceCalc
calcNormalizedDist
in interface DistanceCalc
calcNormalizedDist
in class DistanceCalcEarth
public String toString()
toString
in class DistanceCalcEarth
Copyright © 2012–2020. All rights reserved.