Advertisement
Matthen

Astroids ad Infinitum

Jan 7th, 2012
4,062
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. d\[Theta] = 3;
  2. r[n_] := (1/d\[Theta])^n;
  3. p[0, t_] := {0, 0};
  4. p[n_, t_] :=
  5. p[n, t] =
  6. p[n - 1, t] +
  7. RotationMatrix[(-d\[Theta])^(n - 1) t].{0, r[n - 1] - r[n]};
  8. frame[\[Tau]_] :=
  9. Show[
  10. Graphics[
  11. {
  12. Table[Circle[p[n, \[Tau]], r[n]], {n, 0, 10}]
  13. }
  14. ],
  15. If[\[Tau] < 2 Pi,
  16. Table[
  17. ParametricPlot[p[n, t], {t, -0.01, \[Tau]},
  18. PlotStyle -> ColorData["RedBlueTones"][n/10]], {n, 0, 10}],
  19. Table[
  20. ParametricPlot[p[n, t], {t, \[Tau], 4 Pi + 0.01},
  21. PlotStyle -> ColorData["RedBlueTones"][n/10]], {n, 0, 10}]
  22. ], ImageSize -> 300
  23. ];
  24. Manipulate[frame[t], {t, 0, 4 Pi}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement