chickadee » hexgrid » radius-to-fit

radius-to-fit grid-size container-size marginprocedure

Return the longest hexagon radius (or, equivalently, hexagon side length) such that a grid of grid-size columns and rows will fit in container-size world/screen units, with margin world/screen units left at both sides in the most constrained direction.