[Swlug] Re Re Maths calculations
Rhys Sage
rhys_sage at yahoo.com
Thu Jul 21 12:27:23 UTC 2022
Just when I thought I was safe, Julian came out with a rabbit hole for me to explore. That ended up with Vincenty's formula and the discovery that the Haversine formula has a 0.5% error. Vincenty's formula is correct to 0.5mm, apparently. It is fiendishly complicated and I'm sure my maths lecturer in the institute would look severely at me for not feeling like transposing all that and thinking about a ready implementation.
https://en.wikipedia.org/wiki/Vincenty%27s_formulae
Fortunately it seems that Vincenty is available on Pypi (https://pypi.org/project/vincenty/) and thus available for the Pi Pico.
I think Vincenty is therefore the way to go for distance but Haversine is still probably best for direction. I gather the difference is that Vincenty treats the earth as an elipsoid (which it is) and Haversine treats it as a sphere.
Rhys Sage
More information about the Swlug
mailing list