Calculate distance between two points with latitude and longitude coordinates

/ Published in: JavaScript
Save to your folder(s)

This function calculates distance with the Haversine formula, this formula assumes that our Earth is spherical, but it isn’t since it’s more like a big orange fruit also compresses at poles. I’ve read that this function has an error about + o – 3 meters (it depends), but it’s a small error for many purposes.


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.