I have to do an activity with students in a laboratory where only Mathematica 5.2 is available .
I would to do some animations, but in 5.2, from what I understand, I should select the series of graphics produced by Animation
, or by some other means, and type Ctrl-Y.
Is there some way to automate this process to obtain an animation similar to what is available in later versions of Mathematica?
Answer
I don't have version 5.2, and this type of animation no longer works properly in version 9, which is the oldest version I have installed. So what I show below is only an untested starting point for something more robust. I hope it will be helpful.
animate[frames_] := Module[{},
Scan[Show, frames];
SelectionMove[EvaluationNotebook[], Previous, CellGroup];
FrontEndTokenExecute["OpenCloseGroup"];
FrontEndTokenExecute["SelectionAnimate"]
]
frames
must be a list of graphics, e.g.
frames = Table[
Graphics[{Circle[{0, 0}, 1], Circle[{Cos[x], Sin[x]}, 1]},
PlotRange -> {{-2, 2}, {-2, 2}}, AspectRatio -> 1], {x, 0, 2 Pi, 2 Pi/20}];
animate[frames]
As I remember in v5.2 Show
caused the graphics to be rendered into a new cell, but I may be wrong ... in v6 and later this would be Print
, which I used to test this (sort of, my notebook display gets corrupted when I try it in v9/v10 ...)
Comments
Post a Comment