Skip to content

Commit 75a0c8e

Browse files
committed
Add hilbert image
1 parent cb5e4cf commit 75a0c8e

File tree

5 files changed

+52
-4
lines changed

5 files changed

+52
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ The Hilbert R-tree stores bounding boxes in a flat array and sorts them by their
8888

8989
The Hilbert space-filling curve is a continuous fractal curve that visits every cell in a 2D grid exactly once, maintaining proximity in space:
9090

91-
![Hilbert Curve](docs/hilbert_curve.png)
91+
![Hilbert Curve](docs/hilbert_curve_grid.svg)
9292

9393
The curve preserves spatial locality - points close to each other in 2D space tend to be close along the Hilbert curve order. This property makes the flat array layout extremely cache-friendly for spatial queries.
9494

docs/hilbert_curve.png

-45.9 KB
Binary file not shown.

docs/hilbert_curve_grid.svg

Lines changed: 1 addition & 1 deletion
Loading

examples/hilbert_visualizer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ fn main() {
5858
// Level 3: order 3 (8x8 grid)
5959
// Level 4: order 4 (16x16 grid)
6060
// Level 5: order 5 (32x32 grid)
61-
let order = 5u32; // Change this parameter for different levels
61+
let order = 4u32; // Change this parameter for different levels
6262

6363
let n = 2u32.pow(order) as f64;
6464
let cell_width = grid_width / n;
@@ -85,7 +85,7 @@ fn main() {
8585
svg.push_str(" <defs>\n");
8686
svg.push_str(" <style>\n");
8787
svg.push_str(" .grid-line { stroke: #CCCCCC; stroke-width: 1; }\n");
88-
svg.push_str(" .hilbert-curve { fill: none; stroke: #FF6B35; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }\n");
88+
svg.push_str(" .hilbert-curve { fill: none; stroke: #FF6B35; stroke-width: 3.0; stroke-linecap: round; stroke-linejoin: round; }\n");
8989
svg.push_str(" .grid-box { fill: none; stroke: #333333; stroke-width: 2; }\n");
9090
svg.push_str(" </style>\n");
9191
svg.push_str(" </defs>\n\n");

hilbert_curve_grid.svg

Lines changed: 48 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)