I tried to implement the Haversine formula in Pd which should give you the distance in km between two lat long coordinates.
https://en.wikipedia.org/wiki/Haversine_formula http://www.movable-type.co.uk/scripts/latlong.html
One huge obstacle is the imprecision of the 32bit floats, but even without that I can't get the formula to work. I kept 3 failed implementations in the test-case.
http://rosettacode.org/wiki/Haversine_formula
Could someone give me a hand please?