Hacker News new | ask | show | jobs
by uj8efdkjfdshf 2208 days ago
Why not just internally represent longitude as being between 0 to 360 (mod 360)? This way you won't have a discontinuity in direction when going from one longitude to another.
2 comments

You still have a discontinuity, you've just moved it from the antemeridian (+/-180 degrees) to the prime meridian (0 degrees). The issue isn't the sign, it's the wrapping.

In a lot of ways, this is actually worse. Lots of software can ignore problems posed by antemeridian-crossing geometries because in practice, not that many people encounter them (not many people live there). This would move any problems to the middle of the UK, plus a good chunk of west Africa.

I was wondering the same, lat/long pairs are unique so you could map them to a homogenous sphere and then all of the algebra works as expected.