Polygonal Spiral

Author

Eric W. Weisstein
February 10, 2011

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Graphics/PolygonalSpiral.nb.

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

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

Initialization

PolygonalFilledSpiral::usage="PolygonalFilledSpiral[n,its] gives its iterations of a filled n-sided polygonal spiral.";

PolygonalSpiral::usage="PolygonalSpiral[n,its] gives its iterations of an n-sided polygonal spiral.";

Ngon[n_,R_,ang_]:=Module[{i},Line[2R Sin[Pi/n]Table[{Cos[2Pi i/n+ang],Sin[2Pi i/n+ang]},{i,0,n}]]]

Whirl[n_,its_]:=Module[{i},Table[Ngon[n,Cos[Pi/n]^i,If[OddQ[i],0,Pi/n]],{i,its}]]

Spiral[n_,its_]:=Module[{i},Line[Table[Cos[Pi/n]^(i+1) 2 Sin[Pi/n] {Cos[Pi i/n],Sin[Pi i/n]},{i,0,its}]]]

Spiral2[n_,its_]:=Module[{i},Line[Table[Cos[Pi/n]^(i+2)2 Sin[Pi/n]{Cos[Pi (i-1)/n],Sin[Pi(i-1)/n]},{i,its,0,-1}]]]

FilledSpiral[n_,its_]:=Polygon[Join[Spiral[n,its][[1]],Spiral2[n,its][[1]]]]

PolygonalFilledSpiral[n_,sides_]:=Graphics[{Whirl[n,sides],FilledSpiral[n,sides]},AspectRatio->Automatic,PlotRange->All]

PolygonalSpiral[n_,sides_]:=Graphics[{Whirl[n,sides],{Thickness[.02],Red,Spiral[n,sides]}},AspectRatio->Automatic,PlotRange->All]

Plots

V5

Show[GraphicsArray[PolygonalSpiral[#,20]&/@Range[3,6]],ImageSize->500]

Show[GraphicsArray[PolygonalFilledSpiral[#,20]&/@Range[3,6]],ImageSize->500]

V6

GraphicsGrid[{
PolygonalSpiral[#,20]&/@Range[3,6],
PolygonalFilledSpiral[#,20]&/@Range[3,6]
}]