Advertisement
Matthen

IFS links sierpinski to ferns

Sep 29th, 2011
328
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. f[p_, \[Theta]_] :=
  2. If[RandomReal[] > 0.5, (p + {1, 1})/2, RotationMatrix[\[Theta]].p];
  3. Picture[\[Theta]_, n_] :=
  4. Graphics[{PointSize[Small],
  5. Point[NestList[f[#, \[Theta]] &, {0.2, 0.2}, n][[10 ;;]],
  6. VertexColors ->
  7. ColorData["AvocadoColors"] /@
  8. RandomReal[{0.5, 0.7}, n][[10 ;;]]]},
  9. PlotRange -> {{-2, 2}, {-2, 2}}, Background -> Black,
  10. ImageSize -> {300, 300}];
  11. Manipulate[
  12. Picture[\[Theta], n],
  13. {{\[Theta], 2 Pi/3, "Angle"}, 0, 2 Pi},
  14. {{n, 100, "Number of Points"}, 100, 10000, 1}
  15. ]
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement