Advertisement
Matthen

Same Areas

Jul 11th, 2013
913
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. p1[\[Theta]t_] :=
  2. With[{\[Theta] = Mod[\[Theta]t, 2 Pi]}, If[0 <= \[Theta] < Pi,
  3. {-Cos[\[Theta]], Sin[\[Theta]]},
  4. If[Pi <= \[Theta] < 3 Pi/2,
  5. 0.5 {Cos[2 \[Theta]], Sin[2 \[Theta]]} + {0.5, 0}
  6. ,
  7. If[3 Pi/2 <= \[Theta] < 2 Pi,
  8. 0.5 {-Cos[2 \[Theta]], -Sin[2 \[Theta]]} - {0.5, 0}
  9. ]
  10. ]]
  11. ];
  12. n = 200;
  13. p2[\[Theta]_] := 0.5 {-Cos[\[Theta]], Sin[\[Theta]]} - {0.5, 0};
  14. p1s = Table[p1[\[Theta]], {\[Theta], 0, 2 Pi, 2 Pi/n}];
  15. p2s = Table[p2[\[Theta]], {\[Theta], 0, 2 Pi, 2 Pi/n}];
  16. ps0[t_] := t p1s + (1 - t) p2s;
  17. ps[t_] := Sqrt[Pi] ps0[t]/Sqrt[Abs[area[ps0[t]]]];
  18. area[pts_] :=
  19. Apply[Plus,
  20. Flatten[pts Map[({1, -1} Reverse[#] &), RotateLeft[pts]]]]/2;
  21. \[Alpha] = -1;
  22. Manipulate[
  23. With[{t = If[\[Tau] <= 1, \[Tau], \[Tau] - 1]},
  24. Graphics[
  25. {
  26. If[\[Tau] <= 1, White, {White, Disk[{0, 0}, 1.99], Black}],
  27. Rotate[Polygon[ps[t]], -\[Alpha] (1 - t), {-1, 0}],
  28. Rotate[
  29. Rotate[
  30. Polygon[ps[t]],
  31. -\[Alpha] (1 - t), {-1, 0}
  32. ]
  33. , Pi, {0, 0}]
  34. }
  35. , PlotRange -> 2, Background -> Black]
  36. ]
  37. , {\[Tau], 0, 2}, {invert, {True, False}}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement