Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = 12;
- ngen = 100;
- gen0 = RandomReal[{-1, 1}, {n, 2}];
- nextgen[gen_] := (gen + RotateLeft[gen])/2;
- gens = NestList[nextgen, gen0, ngen];
- frame[m_] := Graphics[{
- If[m - Floor@m == 0,
- {
- FaceForm[None],
- EdgeForm[Directive[Thick, Black]],
- Polygon[gens[[Floor@m]]],
- PointSize[0.025], Black,
- Point[gens[[Floor@m]]]
- },
- If[m - Floor@m == 0.25,
- {
- FaceForm[None],
- EdgeForm[Directive[Thick, Black]],
- Polygon[gens[[Floor@m]]],
- PointSize[0.025], Black,
- Point[gens[[Floor@m]]],
- Red,
- Point[gens[[Floor@m + 1]]]
- }
- ,
- If[m - Floor@m == 0.5,
- {
- FaceForm[None],
- EdgeForm[Directive[Thick, Black]],
- Polygon[gens[[Floor@m]]],
- PointSize[0.025], Black,
- Point[gens[[Floor@m]]],
- Red,
- Point[gens[[Floor@m + 1]]],
- EdgeForm[Directive[Thickness[0.0025], Red]],
- Polygon[gens[[Floor@m + 1]]]
- }
- ,
- If[m - Floor@m == 0.75,
- {
- FaceForm[None],
- EdgeForm[Directive[Thick, Red]],
- Polygon[gens[[Floor@m + 1]]],
- PointSize[0.025], Red,
- Point[gens[[Floor@m + 1]]]
- }
- ,
- {}
- ]
- ]
- ]
- ]
- }
- , PlotRange -> 1, ImageSize -> 300];
- Manipulate[
- frame[m]
- , {m, 1, ngen - 1, 0.25}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement