aboutsummaryrefslogtreecommitdiffstats
path: root/phil-spc.txi
blob: 1193c6cbfe7e3d06c95e4967e7615b3f534c9457 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
@code{(require 'hilbert-fill)}
@ftindex hilbert-fill

@noindent
@cindex Peano
@cindex Hilbert
@cindex Space-Filling
The @dfn{Peano-Hilbert Space-Filling Curve} is a one-to-one mapping
@cindex Peano-Hilbert Space-Filling Curve
between a unit line segment and an @var{n}-dimensional unit cube.

@noindent
The integer procedures map the non-negative integers to an
arbitrarily large @var{n}-dimensional cube with its corner at the
origin and all coordinates are non-negative.

@noindent
For any exact nonnegative integers @var{scalar} and @var{rank},

@example
(= @var{scalar} (hilbert-coordinates->integer
           (integer->hilbert-coordinates @var{scalar} @var{rank})))
                                       @result{} #t
@end example


@defun integer->hilbert-coordinates scalar rank

Returns a list of @var{rank} integer coordinates corresponding to exact
non-negative integer @var{scalar}.  The lists returned by @code{integer->hilbert-coordinates} for @var{scalar} arguments
0 and 1 will differ in the first element.
@end defun

@defun hilbert-coordinates->integer coords

Returns an exact non-negative integer corresponding to @var{coords}, a list
of non-negative integer coordinates.
@end defun