Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 450 Bytes

README.md

File metadata and controls

19 lines (14 loc) · 450 Bytes

haversine

Small Java class for calculating the distance between two points using the Haversine formula.

public static double distance(double startLat, double startLong,
                              double endLat, double endLong)

How to use

Call in a static context:

Haversine.distance(47.6788206, -122.3271205,
                   47.6788206, -122.5271205)

// -> 14.973190481586224 [km]