Class DistanceCalc3D

java.lang.Object
com.graphhopper.util.DistanceCalcEarth
com.graphhopper.util.DistanceCalc3D
All Implemented Interfaces:
DistanceCalc

public class DistanceCalc3D extends DistanceCalcEarth
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
  • 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 0
      toHeight - in meters above 0
    • toString

      public String toString()
      Overrides:
      toString in class DistanceCalcEarth