Expand description
2D Hilbert Space-Filling Curve Mapping.
Maps 2D spatial coordinates $(x, y)$ to a 1D scalar index $d$ and vice-versa, preserving spatial proximity for memory-mapped chunk caching and GPU spatial lookups.
Functionsยง
- hilbert_
to_ xy - Converts a 1D Hilbert index $d$ back to 2D grid coordinates $(x, y)$.
- xy_
to_ hilbert - Converts 2D grid coordinates $(x, y)$ to a 1D Hilbert index $d$.