Crate hilbert_curve

Source
Expand description

hilbert_curve is a simple implementation of Hilbert curve mapping algorithms in Rust.

It assumes a square space divided into n by n cells (n being a power of 2) with integral coordinates: (0, 0) in the lower left corner, (n โˆ’ 1, n โˆ’ 1) in the upper right corner, and a distance d that starts at 0 in the lower left corner and goes to n^2 โˆ’ 1 in the lower-right corner.

Functionsยง

  • Convert a one-dimensional distance d to a pair of (x, y) coordinates.
  • Convert a pair of (x, y) coordinates to a one-dimensional distance.