#hilbert-curve #hilbert #curve #fractal #curve-point #image #graphics

no-std hilbert16

Hilbert transforms between 1D and 2D space, optimized for u16 coordinates

1 unstable release

0.1.0 Jan 3, 2021

#450 in Visualization

Unlicense OR MIT

10KB
156 lines

hilbert16

Hilbert transforms between 1D and 2D space, optimized for u16 coordinates.

License: MIT License: Unlicense crates.io docs.rs

Examples

use hilbert16::{Curve, Point};

let order = 9;
let curve = Curve::new(order).unwrap();
            
let p = Point { x: 175, y: 295 };
println!("{:?} => {}", p, curve.dist_at(p).unwrap();
let d = 94_085;
println!("{} => {:?}", d, curve.point_at(d).unwrap();

lib.rs:

Hilbert transforms between 1D and 2D space, optimized for u16 coordinates.

Examples

use hilbert16::{Curve, Point};

let order = 9;
let curve = Curve::new(order).unwrap();
            
let p = Point { x: 175, y: 295 };
println!("{:?} => {}", p, curve.dist_at(p).unwrap());

let d = 94_085;
println!("{} => {:?}", d, curve.point_at(d).unwrap());

No runtime deps