animation question

• To: mathgroup at smc.vnet.net
• Subject: [mg71360] animation question
• From: "dimitris" <dimmechan at yahoo.com>
• Date: Wed, 15 Nov 2006 06:45:45 -0500 (EST)

```ben wrote:
> Dear Dimitris
>
> Use e.g. Prolog
>
> fr[n_] := Show[
>     Plot[
>       (Sqrt[7*x^4 + 6*x + 5] - Sqrt[7*x^4 + 3*x + 3])*
>         Sqrt[63*x^2 - 5*x + 20], {x, 0, n},
>       Prolog -> {
>           {
>             Red,
>             Line[
>               {
>                 {0, 4.5}, {10, 4.5}
>                 }
>               ]
>             }
>           },
>       PlotRange -> {{0, 10}, {2, 6.5}},
>       Frame -> {True, True, False, False}]]
>
> Table[fr[n], {n, 1, 10, 1}];
> SelectionMove[EvaluationNotebook[], All, GeneratedCell];
> FrontEndTokenExecute["CellGroup"]
> FrontEndTokenExecute["OpenCloseGroup"]
>
> Bye
> Ben
>
> Personally, I prefer to save the animation
> to a file, saves me some trouble with
> complex animations
>
> Export[Table[frame[i],{i,n},"movie.gif"];
> Run["xanim movie.gif"];
>
> dimitris schrieb:
>
> > Consider the simple animation
> >
> > fr[n_] := Show[Plot[(Sqrt[7*x^4 + 6*x + 5] - Sqrt[7*x^4 + 3*x +
> > 3])*Sqrt[63*x^2 - 5*x + 20], {x, 0, n},
> >     PlotRange -> {{0, 10}, {2, 6.5}}, Frame -> {True, True, False,
> > False}], Graphics[{Red, Line[{{0, 4.5}, {10, 4.5}}]}]]
> >
> > Table[fr[n], {n, 1, 10, 0.1}];
> > SelectionMove[EvaluationNotebook[], All, GeneratedCell];
> > FrontEndTokenExecute["CellGroup"]
> > FrontEndTokenExecute["OpenCloseGroup"]
> >
> > How is possible to hold the red line (which has the meaning of the
> > limit as x->infinity; try
> > Limit[(Sqrt[7*x^4 + 6*x + 5] - Sqrt[7*x^4 + 3*x + 3])*Sqrt[63*x^2 - 5*x
> > + 20], x -> Infinity])
> > fixed (i.e. not "animated")?
> >
> > I think where I have inserted the graphic primitive I can't avoid this.
> > But I can't think something other.
> >
> > Regards
> > Dimitris

Dear Ben,
Thanks for bringing to my attention the application of Export command
here.
In the end of your message I believe you would like to write something
like

fr[n_] := Plot[(Sqrt[7*x^4 +
6*x + 5] - Sqrt[7*x^4 + 3*x + 3])*Sqrt[63*x^2 - 5*x + 20], {x, 0,
n},
PlotRange -> {{0, 10}, {2, 6.5}}, Frame -> {True, True, False,
False},
Epilog -> {Red, Line[{{0, 4.5}, {10, 4.5}}]}]

Export["movie.gif", Table[fr[i], {i, 1, 10}], "GIF"];
Run["movie.gif"];

However this seems not to work (or else I do a big mistake)...

The following works very well

Export["movie.avi", Table[fr[i], {i, 0.1, 10, 0.5}], "AVI"];
Run["movie.avi"];

Regards
Dimitris

```

• Prev by Date: Re: 2 dimension Newton Raphson
• Next by Date: Re: Re: Developer`UseFrontEnd + FrontEndExecute + GetBoundingBoxSizePacket
• Previous by thread: Re: animation question
• Next by thread: Interupting long computations