Calculate the distance between two coordinates (haversine formula)
(http://www.script-tutorials.com/useful-php-snippets/)