Regular Polygon Divison by Digonals

Author

Eric W. Weisstein
September 22, 2008

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

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

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

Formula

d[k_,n_]:=DiscreteDelta[Mod[n,k]]

Pieces[n_]:=((n^4)-6(n^3)+23(n^2)-42n+24)/24+(-5(n^3)+42(n^2)-40n-48)/48d[2,n]-3n/4d[4,n]+(-53(n^2)+310n)/12d[6,n]+49n/2d[12,n]+32n d[18,n]+19n d[24,n]-36n d[30,n]-50n d[42,n]-190n d[60,n]-78n d[84,n]-48n d[90,n]-78n d[120,n]-48n d[210,n]

Pieces/@Range[2,41]

FindSequenceFunction[Pieces/@Range[2,41]]

FindLinearRecurrence[Pieces/@Range[2,41]]

Graphic

ShowGraphArray[CompleteGraph/@Range[3,8],AspectRatio->Automatic]

Division Graphic

<<Combinatorica`
<<ComputationalGeometry`

verts[l_]:=Union[Flatten[l/.Line[x_List]:>x,1]]

lines=Cases[g=ShowGraph[CompleteGraph[7],AspectRatio->Automatic],_Line,∞]//Chop;

v=verts[lines];

ineqs[x_,y_]=Inequalities[Polygon[v[[ConvexHull[v]]]],{x,y}]/.Greater:>GreaterEqual

pts=Cases[DeleteCases[Intersections@@@Subsets[lines,{2}],PointAtInfinity],Point[{x_,y_}]/;ineqs[x,y]];

Show[Graphics[{g[[1]],Red,PointSize[.02],pts}],AspectRatio->Automatic]

p=Union[First/@pts,SameTest->(Norm[#1-#2]<10^-6&)]

ListDensityPlot[Append[#,1]&/@p,ColorFunction->(Hue[RandomReal[]]&),InterpolationOrder->0,ImageSize->300,Epilog->{PointSize[.02],Point[First/@pts]},PlotRange->{{0,1},{0,1}}]

nf=Nearest[First/@pts]

DensityPlot[First[nf[{x,y}]],{x,0,1},{y,0,1},PlotPoints->100,ColorFunction->"Rainbow",Epilog->{PointSize[.02],Point[First/@pts]},ImageSize->300]