MathGroup Archive 2007

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

Search the Archive

Re: rotating rings illusion

Imran Akbar wrote:
> Hi,
>    i'm just starting to use mathematica...
> i'm trying to mathematically model the two rotating rings illusion as shown
> in this video:

I am sure that there are better ways than the following, but this one 
works too ;-)  You did not mention what Mathematica version you are 
using, so I will assume 6.0.

> 1)  how do you create a ring in mathematica?  i found the circle command,
> but that's only 2d.

torus[radius_: 1, thickness_: 1] :=
     {Cos[u] (radius + thickness/2 Cos[v]),
      Sin[u] (radius + thickness/2 Cos[v]),
      thickness/2 Sin[v]},
     {u, 0, 2 Pi}, {v, 0, 2 Pi}]

> 2)  how can I orient each ring so that they're perpendicular to each other?

Get the graphics data from inside the Graphics3D[],

tt = First[torus[10]];

and use Rotate[],

gr = Graphics3D[{Rotate[tt, Pi/2, {1,0,0}], tt}]

BTW the rings on the video you posted are not perpendicular to each other.

> 3)  how do I vary the # of rotations per minute in an animation?

  Graphics3D[Rotate[First[gr], j, {1, 1, 1}],
   PlotRange -> {{-11, 11}, {-11, 11}, {-11, 11}}], {j, 0, 2 Pi}]

Use the interactive animation controls.

> much obliged,
> imran

  • Prev by Date: Re: Decompose function into one function for each variable
  • Next by Date: Re: PSLQ
  • Previous by thread: Re: rotating rings illusion
  • Next by thread: Re: rotating rings illusion