Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- f[p_, \[Theta]_] :=
- If[RandomReal[] > 0.5, (p + {1, 1})/2, RotationMatrix[\[Theta]].p];
- Picture[\[Theta]_, n_] :=
- Graphics[{PointSize[Small],
- Point[NestList[f[#, \[Theta]] &, {0.2, 0.2}, n][[10 ;;]],
- VertexColors ->
- ColorData["AvocadoColors"] /@
- RandomReal[{0.5, 0.7}, n][[10 ;;]]]},
- PlotRange -> {{-2, 2}, {-2, 2}}, Background -> Black,
- ImageSize -> {300, 300}];
- Manipulate[
- Picture[\[Theta], n],
- {{\[Theta], 2 Pi/3, "Angle"}, 0, 2 Pi},
- {{n, 100, "Number of Points"}, 100, 10000, 1}
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement