Advertisement
Matthen

Quasicrystals

May 28th, 2013
951
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. wave2 = Compile[{{x, _Real}, {y, _Real}, {t, _Real}},
  2. Sum[Cos[Sin[\[Theta]] x + Cos[\[Theta]] y + t],
  3. {\[Theta], 0, Pi (1 - 1/n), Pi/n}]
  4. , CompilationTarget -> "C"];
  5. n = 7;
  6. width = 200;
  7. X2[t_] := Table[wave2[x, y, t]
  8. , {x, -width, width}, {y, -width, width}];
  9. f[x_] := (1 + Tanh[10 (x - 0.5)])/2;
  10. Manipulate[
  11. ArrayPlot[X2[t],
  12. ColorFunction -> Function[x, GrayLevel[f[x]]]
  13. ]
  14. , {t, 0, 2 Pi}
  15. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement