hilbert_encode
function hilbert_encode(point, size): number;Defined in: hilbert.ts:32
Maps a grid cell to its position along the Hilbert curve.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
point | Point | Integer grid cell, both components in [0, size). |
size | number | Side length of the grid; must be a power of two. |
Returns
Section titled “Returns”number
The curve index, in [0, size²).
Throws
Section titled “Throws”If size is not a power of two, or is above HILBERT_MAX_LEVEL.