jakubcerveny / gilbert

Space-filling curve for rectangular domains or arbitrary size.
BSD 2-Clause "Simplified" License
121 stars 11 forks source link

Implement `d2xy`, `xy2d`, `d2xyz`, `xyz2d` #7

Closed abetusk closed 8 months ago

abetusk commented 8 months ago

It would be nice to have stand alone conversion functions that convert from spatial dimensions to position along the curve (xy2d, xyz2d) and vice versa (d2xy, d2xyz).

As mentioned in #6, this should be possible in $O( \ln N )$ time (and $O(1)$ ish space).

I'm working on this now (here) and hope to issue a PR in the near future when I'm confident enough about the results.