gosper_size
function gosper_size(D, level): number;Defined in: gosper.ts:93
Side length of a level-0 hexagon such that D fits the Gosper island.
The island is sized so the data’s bounding circle fits inside the island’s inscribed circle, measured about the bounding box’s centre — the same point gridify_gosper centres on. Since the inscribed circle lies entirely within the island and the island scales linearly with the size, that is enough to guarantee containment without testing any point.
The radius is the distance to the furthest point, not to the corner of the bounding box. Those coincide only when the data reaches its own corners: uniform data does, so it is unaffected, but clustered and elongated sets leave the corners empty and would otherwise pay for them — about 12% of the cell size, and with it a fifth of the median displacement.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
D | readonly Point[] |
level | number |
Returns
Section titled “Returns”number