iitc-project / ingress-intel-total-conversion

ingress.com/intel total conversion user script with some new features. Should allow easier extension of the intel map.
http://iitc.jonatkins.com/
ISC License
991 stars 552 forks source link

Very long distances calculated incorrectly? #955

Closed wRAR closed 9 years ago

wRAR commented 9 years ago

There is a link between https://www.ingress.com/intel?ll=43.743159,0.964374&z=17&pll=43.743159,0.964374 and https://www.ingress.com/intel?ll=32.752679,-79.874674&z=17&pll=32.752679,-79.874674 IITC shows that the link is longer than 6881 km radius of the first portal which must be wrong. Draw tools show that there is about 6892 kkm between those portals.

jonatkins commented 9 years ago

the real earth isn't a sphere, so any distance calculations based on spherical geometry are by nature approximations

These approximations rely on an earth radius constant, but there's no single 'right' value for this. turns out leaflet used a value based on the equitorial radius, while the s2 geometry library, believed to be at the core of ingress and it's calculations, use a smaller radius value (below the real mean radius, but above the smaller polar radius)

change 522ef34f77c86c54cc7586a298d5a6f74f75aef4 updates leaflet and IITC to use the same radius value as used by the S2 library, and should be close enough