Triangular Grid

Author

Eric W. Weisstein
April 14, 2011

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

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

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

Code

Triangle[x_]:=Line[x+#&/@(Through[{Cos,Sin}[2Pi(#-1/4)/3]]&/@Range[0,3])]
TriangularGrid[x_,y_]:=Module[{i,j},
Table[Triangle[{Sqrt[3](i+Mod[j,2]/2),3/2j}],{i,x},{j,y}]
]

Graphics

V5

Show[Graphics[TriangularGrid[8,8]],
PlotRange->{{2.2,10.2},{2.2,10.2}},
AspectRatio->Automatic]

V6

Graphics[TriangularGrid[8,8],
PlotRange->{{2.2,10.2},{2.2,10.2}},
AspectRatio->Automatic]