chickadee » hexgrid » world->grid

grid>originhex-radiusgrid> pointprocedure

Return the grid coordinates of the hexagon that contains the world/screen point.

origin is the position, in world/screen coordinates, of the cell at row 0, column 0.

hex-radius is the distance, in world/screen coordinates, between the center of a hexagon and any of its vertices (which is the same as the length of one hexagon side).

No bounds wrap-around or checking is done. See horizontal-wrapper, vertical-wrapper or within-bounds? for that.

(Note: curried.)