Advertisement
Matthen

Evolution

Jun 23rd, 2011
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. Clear[ycoords];
  2. ycoords[0] = Accumulate[RandomReal[NormalDistribution[0, 0.2], 20]];
  3. ycoords[n_] :=
  4. ycoords[n] =
  5. ycoords[n - 1] + RandomReal[NormalDistribution[0, 0.05], 20];
  6. Clear[xcoords];
  7. xcoords[0] = Accumulate[RandomReal[NormalDistribution[1, 0.1], 20]];
  8. xcoords[n_] :=
  9. xcoords[n] =
  10. Sort[xcoords[n - 1] + RandomReal[NormalDistribution[0, 0.1], 20]];
  11. k = 100; ListPlot[
  12. Table[RotationMatrix[2 Pi i/(k + 2)].(# + {10, 0}) & /@
  13. Partition[
  14. Riffle[MovingAverage[xcoords[i], 2],
  15. MovingAverage[ycoords[i], 2]], 2], {i, 0, k}], Axes -> None,
  16. Joined -> True, InterpolationOrder -> 3,
  17. PlotStyle -> Table[ColorData["RedBlueTones"][i/k], {i, 0, k}],
  18. ImageSize -> {500}, AspectRatio -> 1, Background -> Black]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement