chickadee » hexgrid » origin-to-center

origin-to-center grid-size hex-radius container-sizeprocedure

Return the position, in world/screen coordinates, for the center of the hexagon at column 0 and row 0, so a grid with grid-size columns and rows where each hexagon has hex-radius distance from center to vertices (or, equivalently, side length) will be centered in a container of container-size width and height in world/screen coordinates.