0

I have mysql query to calculate distance between given longitudes and latitude within 50 meter radius. Here I want to know that by performance, speed and distance accuracy wise which one is better, haversine or pythagorean?

user1522804
  • 149
  • 2
  • 11
  • Pythagorean is probably faster, and while not accurate for distances in the range of dozens or hundred of kilometers, it should be fine for distances under 1km. I'm assuming you mean on earth? – Wug Jul 31 '12 at 22:28
  • pythagorean's accuracy will decrease as you get closer to the poles and become hopelessly wrong if you are really close. it will also give you completely wrong results if the closest path between your points crosses the 180 meridian. I haven't benchmarked it but my guess is the performance difference is negligible (compared to fetching rows from tables). – Vatev Jul 31 '12 at 23:18

0 Answers0