Package com.graphhopper.util
Class DistanceCalc3D
java.lang.Object
com.graphhopper.util.DistanceCalcEarth
com.graphhopper.util.DistanceCalc3D
- All Implemented Interfaces:
DistanceCalc
This class implements a rather quick solution to calculate 3D distances on earth using euclidean
geometry mixed with Haversine formula used for the on earth distance. The haversine formula makes
not so much sense as it is only important for large distances where then the rather smallish
heights would becomes neglectable.
- Author:
- Peter Karich
-
Field Summary
Fields inherited from class com.graphhopper.util.DistanceCalcEarth
C, DIST_EARTH, KM_MILE, METERS_PER_DEGREE, R, R_EQ
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.graphhopper.util.DistanceCalcEarth
calcCircumference, calcCrossingPointToEdge, calcDenormalizedDist, calcDist, calcDist3D, calcDistance, calcDistance, calcNormalizedDist, calcNormalizedDist, calcNormalizedEdgeDistance, calcNormalizedEdgeDistance3D, createBBox, hasElevationDiff, intermediatePoint, isCrossBoundary, isDateLineCrossOver, projectCoordinate, validEdgeDistance
-
Constructor Details
-
DistanceCalc3D
public DistanceCalc3D()
-
-
Method Details
-
calcDist
public double calcDist(double fromLat, double fromLon, double fromHeight, double toLat, double toLon, double toHeight) - Parameters:
fromHeight
- in meters above 0toHeight
- in meters above 0
-
toString
- Overrides:
toString
in classDistanceCalcEarth
-