Skip to content

gilbert_xy2d

function gilbert_xy2d(
px,
py,
W,
H): number;

Defined in: gilbert.ts:75

Maps a cell of a W × H grid to its position along the curve.

Unlike hilbert_encode the grid need not be square nor a power of two, so elongated data can be gridded at its own aspect ratio.

ParameterTypeDescription
pxnumberColumn, in [0, W).
pynumberRow, in [0, H).
Wnumber-
Hnumber-

number

The curve index, in [0, W·H).