[Mathematica] How to use this code?

  • Mathematica
  • Thread starter SoggyBottoms
  • Start date
  • #1
I have a notebook with the following code in it:

Code:
GratingFrame[n_, c_, k_, \[Theta]_, \[Phi]_] := 
  Graphics[Raster[
    Table[0.5 + 
      0.5 c Cos[
        2 Pi k (i  Cos[\[Theta] Pi/180]/n + 
            j Sin[\[Theta] Pi/180]/n) - \[Phi] Pi/180], {j, 1, n}, {i,
       1, n}]]];

GratingMovie[n_, T_, c_, k_, \[Theta]_] :=
 Module[
  {nf = 16},
  ListAnimate[
   Table[GratingFrame[n, c, k, \[Theta], \[Phi]], {\[Phi], 0, 
     360 - 360/nf, 360/nf}], nf/T, ImageSize -> 200, 
   AnimatorElements -> "PlayPauseButton"]
  ]
The idea is to generate two moving images called gratings, using this code, with values n = 64, c = 0.5, k = 1, [itex]\theta = 0[/itex], [itex] \phi = 0[/itex], T = 0.75. Anyone know how I could do that?
 

Answers and Replies

Related Threads on [Mathematica] How to use this code?

Replies
10
Views
3K
Replies
14
Views
3K
Replies
1
Views
3K
  • Last Post
Replies
24
Views
5K
Replies
1
Views
2K
Replies
1
Views
1K
Replies
1
Views
3K
Top