Skip to content

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

License

Notifications You must be signed in to change notification settings

macedoj/haversine-great-circle-distance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages