Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dx = N[Pi/30];
- Manipulate[
- Module[{n, ydrop},
- n = 1 + Floor[t];
- ydrop = 4 - 3.5 (0.5 + 0.5 Tanh[5 (Mod[t, 1] - 0.5)]);
- If[t >= 10, ydrop = 10];
- Graphics[{
- EdgeForm[Black], FaceForm[],
- Table[
- Module[{y = 0.5 + Sum[1/i (1 + 0.5 Sin[i x]), {i, 1, 2 n, 2}],
- y2},
- y2 = Max[y, ydrop] + 1/(2 n + 1) (1 + 0.5 Sin[(2 n + 1) x]);
- {
- FaceForm[
- ColorData["RedBlueTones"][
- 0.5 + 0.4 Sum[4/(Pi i) (Sin[i x]), {i, 1, 2 n, 2}]]],
- Rectangle[{x, 0}, {x + dx, y}],
- FaceForm[ColorData["RedBlueTones"][0.5 + 0.5 Sin[(2 n + 1) x]]],
- Rectangle[{x, Max[y, ydrop] }, {x + dx, y2}]
- }
- ], {x, -2 Pi, 2 Pi, dx}]
- }, PlotRange -> {{-2 Pi, 2 Pi}, {0, 5}}, AspectRatio -> 0.61,
- ImageSize -> 500, ImagePadding -> 2]
- ],
- {t, 0, 10}
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement