Hilbert curve 2d to 1d mapping in JS.
JavaScript HTML Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
notes
t
.gitignore
LICENSE
README.md
bitwise.js
index.js
package.json
present.html
release.ft

README.md

Xy

N-dimensional Hilbert curve mapping in JS.

Documentation:  http://bigeasy.github.io/xy
Source:         http://github.io/bigeasy/xy
Issues:         http://github.com/bigeasy/xy/issues

Install:        `npm install xy`

License:        MIT

Usage:

Get the Hilbert index of an N-dimensional point.

var xy = require('xy')

xy.hilbert([15,0]) // <-- "255"
xy.hilbert([1,1,0,1]) // <-- "9"

Get a point given dimension and Hilbert index.

xy.hilbertInverse(2,0) // <-- "[0,0]"
xy.hilbertInverse(3,63) // <-- "[3,0,0]"