|
This page shows how to create (mathematical) animations for the web using Mathematica
and GIF Construction Set. For information on Mathematica visit Wolfram Research and for information
on GIF Construction Set visit Alchemy
Mindworks Inc.
Step 1 - Generating the Graphs with Mathematica
You can cut an paste in Mathematica the command s below. If you do so, before you
evaluate them, make sure that they are entered and inputs.
- Select the number of graphs, say n , you want to use for the
animation (number of frames)
- Select the command that will generate the graphs. Choose a name for each of these
graphs, say fig[k], where k is a number between 1 and n.
- Use the following command to generate each and name each picture
n = (*enter her the number of frames*);
Evaluate[Map[fig,Range[n]]]=(*enter here the command that generate the graphs*)
Make sure that the number of pictures that your command generates is equal to n.
- Select a path and directory to save all the graphs. Each graph must be saved in
"GIF" format. We can do this at once for all graphs using the
following command
Display[StringJoin["(*enter path and directory
here*)\\fig[",ToString[#],"].gif"],fig[#],"GIF"]&/@
Range[n]
This command will save all the graphs in the directory you selected under the
names fig[k].gif, for each k between 1 and n.
Step 2 - Animating the Graphs with GIF Construction Set
- Start GIF Construction Set.
- Go to File and from the dropdown menu choose Animation Wizard
- The Animation Wizard will walk through all the steps.
Examples
The following command in Mathematica will generate the red graphs of the function sin
x on the intervals [-a,a] for 10 different values of a, with black background and
without the coordinate axes.
n = 10;
Evaluate[Map[fig, Range[n]]]=
Table[Evaluate[Plot[ Sin[x], {x, -4Pi k/n , 4Pi k/n}, PlotStyle->RGBColor[1,0,0],
Axes->False, Background->RGBColor[0,0,0]]], {k, 1, n}]
After assembling the graphs with GIF Construction Set we get the following animation.
|