Crates.io | hilbert16 |
lib.rs | hilbert16 |
version | 0.1.0 |
source | src |
created_at | 2021-01-03 00:10:57.99354 |
updated_at | 2021-01-03 00:10:57.99354 |
description | Hilbert transforms between 1D and 2D space, optimized for u16 coordinates. |
homepage | https://github.com/ryanavella/hilbert16 |
repository | https://github.com/ryanavella/hilbert16 |
max_upload_size | |
id | 330791 |
size | 11,858 |
Hilbert transforms between 1D and 2D space, optimized for u16 coordinates.
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();