Advertisement
Matthen

two ellipses = circle

May 18th, 2016
1,413
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. dx = N[2/36];
  2. a = 0.5;
  3. c1 = ColorData["DarkRainbow"][0];
  4. c2 = ColorData["DarkRainbow"][1];
  5. Manipulate[
  6. With[{t = 0.25 + 0.67 (0.5 + 0.5 Sin[2 Pi \[Tau]])},
  7. Graphics[
  8. Translate[
  9. {
  10. {
  11. c1,
  12. Table[
  13. With[{y = Max[1 - t, a Sqrt[1 - x^2]]},
  14. Line[{{x, y - a Sqrt[1 - x^2]}, {x, y + a Sqrt[1 - x^2]}}]
  15. ], {x, -1 + dx/2, 1, dx}]
  16. },
  17. {
  18. c2,
  19. Table[
  20. With[{y = Min[-1 + t, -a Sqrt[1 - x^2]]},
  21. Line[{{x, y - a Sqrt[1 - x^2]}, {x, y + a Sqrt[1 - x^2]}}]
  22. ], {x, -1 + dx/2, 1, dx}]
  23. }
  24.  
  25. },
  26. {0, -t}
  27. ], PlotRange -> {{-1, 1}, {-1.25 - 0.75, 1.25}},
  28. ImagePadding -> 10]
  29. ],
  30. {\[Tau], 0, 1}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement