Manual Reference Pages - HILBERT_I2C (3)
hilbert_i2c, hilbert_c2i - Compute points on a Hilbert curve.
void hilbert_i2c( dim, bits, idx, coords )
int dim, bits;
long int idx;
void hilbert_c2i( dim, bits, coords, idx )
int dim, bits;
long int *idx;
These procedures map the real line onto a Hilbert curve and vice
versa. (A Hilbert curve is a space filling curve similar to the Peano
curve, except it is not closed.) The procedure hilbert_i2c
returns the coordinates of a point on the Hilbert curve, given an
index value representing its sequential position on the curve. The
procedure hilbert_c2i reverses the process. The arguments are:
The dimensionality of the Hilbert curve. For the usual planar curve
case, this would be 2.
The resolution to which the Hilbert curve will be computed. The space
is quantized to 2^bits values on each axis, so there are
2^(3*bits) points on the curve. The product of
dim*bits should be less than or equal to the number of
bits in a long integer (typically 32), and bits should be less
than or equal to the number of bits in an integer.
The sequential position of the point along the curve (starting from
0). This is a 3*bits bit integer.
The spatial coordinates of the point on the curve. The array should
hold dim values. Each is a bits bit integer.
A. R. Butz, "Alternative algorithm for Hilberts space-filling
curve," IEEE Trans. Comput., vol C-20, pp. 424-426, Apr. 1971.
Spencer W. Thomas
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.