Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- p1[\[Theta]t_] :=
- With[{\[Theta] = Mod[\[Theta]t, 2 Pi]}, If[0 <= \[Theta] < Pi,
- {-Cos[\[Theta]], Sin[\[Theta]]},
- If[Pi <= \[Theta] < 3 Pi/2,
- 0.5 {Cos[2 \[Theta]], Sin[2 \[Theta]]} + {0.5, 0}
- ,
- If[3 Pi/2 <= \[Theta] < 2 Pi,
- 0.5 {-Cos[2 \[Theta]], -Sin[2 \[Theta]]} - {0.5, 0}
- ]
- ]]
- ];
- n = 200;
- p2[\[Theta]_] := 0.5 {-Cos[\[Theta]], Sin[\[Theta]]} - {0.5, 0};
- p1s = Table[p1[\[Theta]], {\[Theta], 0, 2 Pi, 2 Pi/n}];
- p2s = Table[p2[\[Theta]], {\[Theta], 0, 2 Pi, 2 Pi/n}];
- ps0[t_] := t p1s + (1 - t) p2s;
- ps[t_] := Sqrt[Pi] ps0[t]/Sqrt[Abs[area[ps0[t]]]];
- area[pts_] :=
- Apply[Plus,
- Flatten[pts Map[({1, -1} Reverse[#] &), RotateLeft[pts]]]]/2;
- \[Alpha] = -1;
- Manipulate[
- With[{t = If[\[Tau] <= 1, \[Tau], \[Tau] - 1]},
- Graphics[
- {
- If[\[Tau] <= 1, White, {White, Disk[{0, 0}, 1.99], Black}],
- Rotate[Polygon[ps[t]], -\[Alpha] (1 - t), {-1, 0}],
- Rotate[
- Rotate[
- Polygon[ps[t]],
- -\[Alpha] (1 - t), {-1, 0}
- ]
- , Pi, {0, 0}]
- }
- , PlotRange -> 2, Background -> Black]
- ]
- , {\[Tau], 0, 2}, {invert, {True, False}}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement