- /
-
Quasicrystal Art
on 6 Oct 2022
- 4
- 117
- 5
- 1
- 129
% Quasicrystal visualization via summation of plane waves
% Based on my File Exchange submission:
% https://mathworks.com/matlabcentral/fileexchnage/56593
N=512; % Dimension of output image
s=20; % Scale - number of periods per wave
m=7; % Integer number of plane waves to sum (m-fold symmetry)
p=1; % Phase parameter - vary to animate output
x=ones(N,1)*(-1:2/(N-1):1)*pi*s;
q=0;
for a=(0:m-1)*pi/m % Sum m plane waves over [0, pi)
q=q+cos(x*cos(a)+x'*sin(a)+p);
end
imshow((cos(q+2)+1)/2,'C',jet) % Wrap output to [0,1], apply colormap