The first I am trying to export animations from Mathematica to a file and then to LaTeX. Don't assume I know anything about what I'm doing.
The following definitions defines the still image of a single frame. It is a stick of length $k$ that has two pivot points: one sliding along $x$-axis, $\{\cos u,0\}$, and the other, along the $y$-axis. $\{0,\sin u\}$, so the distance between the two pivots is always equal to $1$ irrespective of the value of the parameter $u$. One end of the stick is at the $y$-axis pivot, and the other is determined by the length of the stick. That other endpoint draws an ellipse, as $u$ increases from $0$ to $2\pi$.
tikku[u_, k_] :=
Show[{ParametricPlot[{k Cos[x], (1 - k) Sin[x]}, {x, 0, u}],
Graphics[{Line[{{k Cos[u] + 0.05 Sin[u], (1 - k) Sin[u] +
0.05 Cos[u]}, {0.05 Sin[u],
Sin[u] + 0.05 Cos[u]}, {-0.05 Sin[u],
Sin[u] - 0.05 Cos[u]}, {k Cos[u] -
0.05 Sin[u], (1 - k) Sin[u] - 0.05 Cos[u]}, {k Cos[u] +
0.05 Sin[u], (1 - k) Sin[u] + 0.05 Cos[u]}}]}],
Graphics[{PointSize[0.02], {Point[{Cos[u], 0}],
Point[{0, Sin[u]}]}}]}, PlotRange -> {{-2.2, 2.2}, {-1.2, 1.2}},
AspectRatio -> Automatic, AxesOrigin -> {0, 0}, Axes -> True]
Then I create an animation with
movie = Animate[tikku[u, 1.8], {u, 0, 2 Pi}, Alignment -> Center]
That is displayed as expected. But when I export that file with the command
Export["Analyysi I/2013/ellipsi.swf", movie]
and open the resulting .swf
file with Adobe Reader I get the following error message (my translation from Finnish): "Adobe Reader couldn't open the file "ellipsi.swf", because it is of an unsupported type...."
I can open the .swf
-file in IE. If I export the animation as an .avi-file instead, then I can also view it in Windows Media Player. However, something seems to have gone wrong while exporting, because at the beginning (and also at the end) a frame with Mathematica code is shown instead of the first frame of the animation.
Questions:
- What should I do to make it viewable in Adobe Reader? (I just installed flashplayer, but that didn't help) This is kinda crucial for including the animation to a slide set produced by LaTeX.
- What should I do to get rid of that extraneous first frame?
tikku[0.0,1.8]
and you'll get error messages. I actually got a much better animation usingmovie2=Table[tikku[u,1.8],{u,0.01,2.0 Pi,Pi/32.0}];Export["test2.swf",movie2];
That answers your question 2), but about question 1) I'm not sure. To narrow down the problem, you should download an SWF file not created by Mathematica from the web and try to embed it in a pdf. If that works and plays properly, then we can try to figure out what is different about Mathematica-generated SWF files. $\endgroup$