Hexagonal Grid

Author

Eric W. Weisstein
April 14, 2011

This notebook downloaded from http://mathworld.wolfram.com/notebooks/PlaneGeometry/HexagonalGrid.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/HexagonalGrid.html.

©2011 Wolfram Research, Inc. except for portions noted otherwise

Code

Hexagon[x_]:=Line[x+#&/@(Through[{Cos,Sin}[Pi#/3]]&/@Range[0,6])]

HexagonalGrid[x_,y_]:=Module[{i,j},
Table[Hexagon[{3/2i,Sqrt[3]j+Mod[i,2]Sqrt[3]/2}],{i,x},{j,y}]
]

Graphics

V5

Show[Graphics[HexagonalGrid[7,7]],
PlotRange->{{.7,10.2},{.7,10.2}},
AspectRatio->Automatic]

V6

Graphics[HexagonalGrid[7,7],
PlotRange->{{.7,10.2},{.7,10.2}},
AspectRatio->Automatic]