Skip to main content

xy_to_hilbert

Function xy_to_hilbert 

Source
pub fn xy_to_hilbert(x: u32, y: u32, order: usize) -> u64
Expand description

Converts 2D grid coordinates $(x, y)$ to a 1D Hilbert index $d$.

order: Bits per dimension (e.g. order 6 for $64 \times 64$ grid, order 16 for $65536 \times 65536$).