Pushed Around
Continuing with the theme (1, 2, 3, 4), this is another closed geodesic in polygon space. For some reason, I've almost never used Dashing
before, but it's kind of fun to play around with.
Here's the code:
ToReal[z_] := {Re[z], Im[z]};
ToComplex[{x_, y_}] := x + I y;
FrameToPol[{A_, B_}] := ToReal[ToComplex[#]^2] & /@ Transpose[{A, B}];
FrameToVertices[{A_, B_}] := Accumulate[FrameToPol[{A, B}]];
Manipulate[Module[{cols, fr, dfr, θ, verts},
cols = RGBColor /@ {"#00C3FF", "#3B475E"};
fr = Transpose[
ToReal[Sqrt[#]] & /@
Table[2/5 E^(I θ), {θ, π/5,
4 π + π/5 - 4 π/5, 4 π/5}]];
dfr = Transpose[
ToReal[Sqrt[#]] & /@
Table[2/5 E^(I θ), {θ, π/5,
2 π + π/5 - 2 π/5, 2 π/5}]];
θ = π (1/2 - 1/2 Cos[π s]);
Graphics[{FaceForm[None],
EdgeForm[
Directive[cols[[1]], JoinForm["Round"], CapForm["Round"],
Dashing[{.02, .04}], Thickness[.005]]], {
verts =
RotationMatrix[4 π/5].# & /@
FrameToVertices[Cos[θ] fr + Sin[θ] dfr];
Polygon[-Mean[verts] + # & /@ verts]}}, ImageSize -> 540,
PlotRange -> 1/Sqrt[2], Background -> cols[[2]]]], {s, 0., 1}]