Skip to content

Instantly share code, notes, and snippets.

View ClancyWalters's full-sized avatar

Clancy Walters ClancyWalters

  • Raytheon Australia
  • Adelaide, Australia
  • 22:15 (UTC +10:30)
View GitHub Profile
@missinglink
missinglink / wrap.js
Last active October 1, 2025 20:37
wrap latitude and longitude values around the poles in order to normalize their ranges
/**
normalize co-ordinates that lie outside of the normal ranges.
longitude wrapping simply requires adding +- 360 to the value until it comes
in to range.
for the latitude values we need to flip the longitude whenever the latitude
crosses a pole.
**/