Class HaversineCalculator
- java.lang.Object
-
- de.hybris.platform.warehousing.sourcing.context.util.HaversineCalculator
-
public class HaversineCalculator extends java.lang.ObjectCalculate 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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doublecalculate(double lat1, double lon1, double lat2, double lon2)Get the distance between 2 points on the surface of the planet (in kilometers).
-
-
-
Method Detail
-
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
-
-