Skip to content

Commit

Permalink
readme: explain result of construct()
Browse files Browse the repository at this point in the history
  • Loading branch information
mhyfritz committed Oct 3, 2019
1 parent 0a0f945 commit 6135f62
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ Construct the Hilbert curve of order `order` from `data`, e.g.
const data = Array.from({ length: 4 * 4 }, (_, i) => i + 1);
hilbertCurve.construct(data, 2);
// [1, 2, 15, 16, 4, 3, 14, 13, 5, 8, 9, 12, 6, 7, 10, 11]
// to be interpreted as 4x4 square:
// 1 2 15 16
// 4 3 14 13
// 5 8 9 12
// 6 7 10 11
```

[Try `hilbert-curve` in your browser.](https://npm.runkit.com/hilbert-curve)

0 comments on commit 6135f62

Please sign in to comment.