Rigid Circle Packing

Author

Eric W. Weisstein
April 27, 2011

This notebook downloaded from http://mathworld.wolfram.com/notebooks/ComputationalGeometry/RigidCirclePacking.nb.

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

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

Circles within Circles

CirclePacking[m_,n_,1]:=Module[{i,j,x=Sqrt[3]/2,y=2/Sqrt[3]},
	Graphics[{
		Table[{
			Circle[{i x,3j },.5],
			Circle[{i x,3j+1},.5],
			Circle[{(i+1) x,3j+1.5 },.5],
			Circle[{(i+1)x,3j+2.5},.5]},
			{i,2,m,2},{j,1,n/4}]
		}]
	]

circles[{x_,y_},R_]:=Module[
		{ym=(4-2Sqrt[3])R,r=(2Sqrt[3]-3)R,yp=(2-Sqrt[3])R},
		If[Mod[y,3]==0 || Mod[y-.5,3]==1,
			{Circle[{x-r,y-yp},r],Circle[{x+r ,y-yp},r],Circle[{x,y+ym},r]},
		{Circle[{x-r,y+yp},r],Circle[{x+r ,y+yp},r],Circle[{x,y-ym},r]}
			]
]

CirclePacking[m_,n_,2]:=Module[{},
	Graphics[CirclePacking[m,n,1][[1]] /. Circle->circles]
]

Show[Graphics[{Circle[{0,0},1],circles[{0,0},1]}],
AspectRatio->Automatic]

Show[GraphicsArray[{
			Show[CirclePacking[8,8,1],AspectRatio->Automatic,DisplayFunction->Identity],
			Show[{CirclePacking[8,8,1],CirclePacking[8,8,2]},
			AspectRatio->Automatic,DisplayFunction->Identity],
					Show[CirclePacking[8,8,2],AspectRatio->Automatic,DisplayFunction->Identity]
}]]

Simplify[(1/6 Pi Sqrt[3])2/3 3(2Sqrt[3]-3)^2 ]

N[%,10]

N[Pi/6 Sqrt[3],10]