- #1
SoggyBottoms
- 59
- 0
I have a notebook with the following code in it:
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?
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?