0

I'm looking to navigate between two GPS points which will be roughly 1 mile or less apart from each other. I need to find an accurate distance between them. From what I've read so far, haversine formula assumes the earth to be a sphere and due to the earth's irregular shape, the distance won't be accurate. How to take care of this and get accurate readings?

  • The accepted answer on [another question](https://stackoverflow.com/questions/1185408) speaks of "0.5% average error" (which is not trivial to express as a tolerance in miles) when using the haversine formula. – Peter O. Mar 11 '19 at 13:45

2 Answers2

1

The "accurate" distance is subjective here.

Let me explain...

Do you mean the distance over the road? Do you go by bike, or by car? Or by plane? And do you mean the mathematically shortest distance as a straight line? The shortest possible distance over the surface of the earth?

And do you realize that the smaller the accuracy becomes, the longer the distance will be? Read more about that here: https://en.wikipedia.org/wiki/Coastline_paradox It's an interesting read, and if you get it, it'll make you look at your own question in a different way.

Now, if you forget about the real 3d representation, and just assume that the earth is a bit of an elipse-like sphere, things become a lot easier.

In that case, using the haversine formula is probably best for distances of about a mile, especially if you up multiple shorter distances to get a longer one.

If you're talking about GPS data that's measured every second, and you only care about the distance between two points, it's good enough to assume that the earth is flat. But the same goes here: it's fine as long as you don't do it over long distances, or if you add up multiple short distances.

Wouter van Nifterick
  • 23,603
  • 7
  • 78
  • 122
  • Hi, thanks for responding. I mean distance over the road by a small car. I don't mean the shortest distance. Just the distance. But I guess your last paragraph makes sense. Thanks! – Shantanu Mhapankar Mar 11 '19 at 14:14
0

Yes indeed you will not be able to accurately measure this distance. However, in some areas recently equipped with wifi signals, improvements are made based on the wavelengths of the wifi signals. Also digital compass sensors are sometimes used for this task.

Halil Sahin
  • 568
  • 1
  • 6
  • 25
  • Thanks for replying, Halil. Can you tell me how to use a compass to get the accurate distance? – Shantanu Mhapankar Mar 10 '19 at 21:56
  • Yes @Shantanu Mhapankar i can. So there is video in Youtube which it name is Make an Autonomous "Follow Me" Cooler - Part 1 and its also have Part -2. At that video you can see how the do that and how's work and whats the formula for improving GPS signals. – Halil Sahin Mar 10 '19 at 22:00
  • This answer is not relevant to the question. The question is about distance between two points, but not about getting of accurate GPS location. – fdermishin May 24 '20 at 17:44