SHARE
TWEET

Curly chaps

Matthen Nov 23rd, 2013 2,002 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Lines[l_] := Module[{curr, \[Theta] = 0, out = {}},
  2.    curr = {{0, 0}, {1, 0}};
  3.    AppendTo[out, curr];
  4.    Do[
  5.     \[Theta] = N@l[[i]];
  6.     curr = Map[# + (curr[[2]] - curr[[1]]) &, curr];
  7.     curr[[2]] = RotationTransform[\[Theta], curr[[1]]][curr[[2]]];
  8.     AppendTo[out, curr];
  9.     , {i, Length[l]}
  10.     ];
  11.    out
  12.    ];
  13. angles = Table[0.08 i, {i, 3635}];
  14. lines = Lines[angles];
  15. anglesaccum = Join[{0}, Accumulate[angles]];
  16. frame[n_] :=
  17.  
  18.   Graphics[{{Opacity[0.8], ColorData["DarkRainbow"][0],
  19.      Thickness[0.005], Line@lines[[;; n]]},
  20.     If[n > 1, {
  21.       Darker@Red, EdgeForm[], FaceForm[Opacity[0.4]], Thickness[0.01],
  22.        Disk[lines[[n, 1]],
  23.        0.5, {anglesaccum[[n]], Pi + anglesaccum[[n - 1]]}
  24.        ]
  25.       }, {}],
  26.     Darker@Blue,
  27.     If[n < 200, Map[Disk[First[#], 0.05] &, lines[[;; n]]], {}]},
  28.    PlotRange -> All, ImageSize -> {300, 300}, Background -> White];
  29. ts = Join[Range[35], 35 + Range[20]*2, 75 + Range[40]^2];
  30. Manipulate[frame[ts[[i]]], {i, 1, Length@ts, 1}]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top