- /
-
Quasicrystal Log Normal Contours
on 27 Oct 2022
- 6
- 37
- 0
- 1
- 159
% Quasicrystal visualization via summation of plane waves
% Display with log-normal mapping
% Based on my File Exchange submission:
% https://mathworks.com/matlabcentral/fileexchnage/56593
N=512; % Dimension of output image
s=24; % Scale - number of periods per wave
m=6; % Integer number of plane waves to sum (m-fold symmetry)
p=1; % Phase parameter - vary to animate output
x=ones(N,1)*(1-N:2:N-1)/2;
r=-log(hypot(x,x'))*s;
x=atan2(x',x)*s;
q=0;
for a=(0:m-1)*pi/m % Sum m plane waves over [0, pi)
q=q+cos(x*cos(a)+r*sin(a)+p);
end
imshow((cos(q)+1)/2,'C',copper); % Wrap output to [0,1], apply colormap