hilbert-curve-rust 0.1.0

Basic Hilbert curve algorithm
Documentation

Hilbert Curve Algorithm

Rust implentation of the Hilbert Curve algoritm. The library allows to move from point to index and index to point.

How to use?

Index to point

let hilbert_curve = HilbertCurveAlgorithm::new(1); // Set the Hilbert order here
let point = hilbert_curve.index_to_point(0); // Get the point for index 0

Point to index

let hilbert_curve = HilbertCurveAlgorithm::new(1);// Set the Hilbert order here
let index = hilbert_curve.point_to_index(CoordinateValue { x: 0, y: 0 }); // Get the index for (0,0) point

Test and Coverage

Coverage

rustup component add llvm-tools-preview
export RUSTFLAGS="-Cinstrument-coverage"
cargo build
export LLVM_PROFILE_FILE="your_name-%p-%m.profraw"
cargo test
grcov . -s . --binary-path ./target/debug/ -t html --branch --ignore-not-existing -o ./target/debug/coverage/

Further explanation in the Mozilla grcov website

Documentation

cargo doc --open