Class HaversineCalculator
java.lang.Object
de.hybris.platform.warehousing.sourcing.context.util.HaversineCalculator
Calculate the distance between 2 points on the surface on the planet. This formula uses the radius of the Earth in
kilometers as 6372.8 km.
-
Method Summary
Modifier and TypeMethodDescriptionstatic doublecalculate(double lat1, double lon1, double lat2, double lon2) Get the distance between 2 points on the surface of the planet (in kilometers).
-
Method Details
-
calculate
public static double calculate(double lat1, double lon1, double lat2, double lon2) Get the distance between 2 points on the surface of the planet (in kilometers).- Parameters:
lat1- - the latitude of the first pointlon1- - the longitude of the first pointlat2- - the latitude of the second pointlon2- - the longitude of the second point- Returns:
- the distance between the 2 points
-