MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Animation

  • To: mathgroup at smc.vnet.net
  • Subject: [mg120746] Re: Animation
  • From: Heike Gramberg <heike.gramberg at gmail.com>
  • Date: Tue, 9 Aug 2011 07:17:10 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201108080818.EAA04542@smc.vnet.net>

Do you mean something like this?

Manipulate[m = 1.0;
 b1 = 1;
 b2 = 0;
 b3 = 0;
 {x1, x2, x3} = 
  b1*Cos[t]*{1, 0, -1} + 
   b2*Cos[Sqrt[(2 + Sqrt[2])]*t]*{1, -Sqrt[2], 1} + 
   b3*Cos[Sqrt[(2 - Sqrt[2])]*t]*{1, Sqrt[2], 1};
 balls = Graphics[{Black, 
    Line[{{0, 0}, {1, x1}, {2, x2}, {3, x3}, {4, 0}}], 
    Red, {Disk[{1, x1}, .1 Sqrt[m]], Disk[{2, x2}, .1 Sqrt[m]], 
     Disk[{3, x3}, .1 Sqrt[m]]}}, PlotRange -> {{0, 4}, {-1, 1}}, 
   Frame -> True, ImageSize -> {400, 250}], {t, 0, 2 Pi}]

If you replace Manipulate with Animate you get an actual animation.

Heike.

On 8 Aug 2011, at 10:18, DaleJenk wrote:

> How can I animate the following:
> 
> Manipulate[
> m = 1.0;
> b1 = 1;
> b2 = 0;
> b3 = 0;
> {x1, x2, x3} = 
>  a = b1*Cos[t]*{1, 0, -1} + 
>    b2*Cos[Sqrt[(2 + Sqrt[2])]*t]*{1, -Sqrt[2], 1} + 
>    b3*Cos[Sqrt[(2 - Sqrt[2])]*t]*{1, Sqrt[2], 1}, {t, 0, 5}]
> balls = Graphics[{Black, 
>   Line[{{0, 0}, {1, x1}, {2, x2}, {3, x3}, {4, 0}}], 
>   Red, {Disk[{1, x1}, .1 Sqrt[m]], Disk[{2, x2}, .1 Sqrt[m]], 
>    Disk[{3, x3}, .1 Sqrt[m]]}}, PlotRange -> {{0, 4}, {-1, 1}}, 
>  Frame -> True, ImageSize -> {400, 250}]
> 
> 
> Thanks for any help.
> 
> 





  • References:
    • Animation
      • From: "DaleJenk" <dale.jenkins8@deletegooglemail.com>
  • Prev by Date: Re: BinaryWrite[...] / OpenWrite[...] / random access in file
  • Next by Date: Re: Problems with NETLink C#
  • Previous by thread: Animation
  • Next by thread: Animation