Skip to content

Latest commit

 

History

History
20 lines (12 loc) · 1.01 KB

README.md

File metadata and controls

20 lines (12 loc) · 1.01 KB

great-circle-distance-calculator

Haversine formula implementation in Java to calculate the great-circle distance between two pairs of latitude and longitude coordinates.

Features

The HaversineAlgorithm.java class have tow implemented methods and both return the great-circle distance between tow points, using the Haversine formula.

  • The distanceInKm(...) method return their result in the Kilometers (Km) unit type.
  • The distanceInMi(...) method return their result in the Miles (Mi) unit type, through a simple conversion of Km to Mi.

Unit test

To ensure accurate results from the Haversine formula implementation, the HaversineAlgorithm.java class are fully reviewed by unit tests, that can be found in class HaversineAlgorithmTest.java.

License

License (MIT)

Copyright 2017, Juliano Macedo. See LICENSE file for details.