Another closed geodesic in polygon space, this time with 17-gons (see here, here, and here for more examples and background).
Here’s the source code (following a suggestion of @Todd Rowland, I’m now using a single DynamicModule rather than two nested Modules):
Here’s the source code (following a suggestion of @Todd Rowland, I’m now using a single DynamicModule rather than two nested Modules):
In[]:=
ToReal[z_]:={Re[z],Im[z]};ToComplex[{x_,y_}]:=x+Iy;FrameToEdges[frame_]:=ToReal[ToComplex[#]^2]&/@Transpose[frame];FrameToVertices[frame_]:=Accumulate[FrameToEdges[frame]];DualFourFrame[frame_]:=Orthogonalize[NullSpace[frame]];DynamicModule[{n,a,b,cols,θ,fr,dfr,verts},n=17;a=9;b=3;cols=RGBColor/@{"#FF7844","#23425F"};Manipulate[θ=π/2(1/2-1/2Cos[π(s-Floor[s])]+Floor[s]);fr=Transpose[ToReal[Sqrt[#]]&/@Table[2/nE^(Iθ),{θ,π(b-1)/n,2πb+π(b-1)/n-2πb/n,2πb/n}]];dfr=Transpose[ToReal[Sqrt[#]]&/@Table[2/nE^(Iθ),{θ,π(a-1)/n,2πa+π(a-1)/n-2πa/n,2πa/n}]];Graphics[{FaceForm[None],EdgeForm[Directive[JoinForm["Round"],cols[[1]],Thickness[.0045]]],{verts=FrameToVertices[Cos[θ]fr+Sin[θ]dfr];Polygon[-Mean[verts]+#&/@verts]}},ImageSize->540,PlotRange->.3,Background->cols[[2]]],{s,0,-2}],SaveDefinitions->True]
Out[]=

