Geoboard

Author

Eric W. Weisstein
May 11, 2002

This notebook downloaded from http://mathworld.wolfram.com/notebooks/PointLattices/Geoboard.nb.

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

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

Initialization

<<Graphics`Colors`;
<<DiscreteMath`ComputationalGeometry`;

Graphic

Geoboard[d_List,opts___]:=Module[{i,j,m,n,lines},
{m,n}=d;
lines=Lines/.{opts}/.{Lines->{}};
{
{Hue[Random[]],Line[Append[#,First[#]]]}&/@lines,
Map[Point,Table[{i,j},{i,m},{j,n}],{2}],
Line[{1,1}/2.+#&/@{{0,0},{0,n},{m,n},{m,0},{0,0}}]
}
]

Geoboard[m_Integer,lines___]:=Geoboard[{m,m},lines]

pts=Table[Table[Random[Integer,{1,11}],{2}],{3},{Random[Integer,{3,4}]}]

convexpts=#[[ConvexHull[#]]]&/@pts

Show[Graphics[
Geoboard[11,
Lines->convexpts
],
AspectRatio->Automatic]]