Skip to content

Instantly share code, notes, and snippets.

View ClancyWalters's full-sized avatar

Clancy Walters ClancyWalters

  • Swinburne University of Technology
  • Melbourne, Australia
View GitHub Profile
@missinglink
missinglink / wrap.js
Last active May 1, 2024 16:50
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.
**/