Hello everyone!
I thought I'd share a quick tutorial for exporting GIFs in Mathematica, since I get asked that a lot, and I think it's a great way of sharing interesting visualisations with a large audience on the web.
First define a function frame:
frame[t_] :=
Show[
Graphics[{Circle[{-1, 0}, 1], PointSize[Large],
Point[{Sin[t] - 1, Cos[t]}], Red,
Line[{{-1, 0}, {Sin[t] - 1, Cos[t]}, {0, Cos[t]}}]}],
Plot[Cos[x + t], {x, 0, 2 Pi}, PlotRange -> {-1, 1}],
ImageSize -> 300];
Then generate a list of the frames (not including the last frame here, as frame[2 Pi] is the same as frame[0]):
frames = Table[frame[t], {t, 0, 2 Pi, (2 Pi)/50}][[;; -2]];
Now you can export this as a gif:
Export["animation.gif", frames]