• Remix
  • Share
  • New Entry

on 18 Oct 2024
  • 24
  • 92
  • 0
  • 0
  • 215
Cite your audio source here (if applicable):
drawframe(1);
Write your drawframe function below
function drawframe(f)
% Quasicrystal animation via summation of plane waves
% Based on my File Exchange submission:
% https://mathworks.com/matlabcentral/fileexchnage/56593
N = 800; % Dimension of output image
s = 20; % Scale - number of periods per wave
m = 5; % Integer number of plane waves to sum (m-fold symmetry)
p = (f-1)*pi/16; % Phase parameter - vary to animate output
% Scaled x-coordinate data
x = ones(N, 1)*(-1:2/(N-1):1)*pi*s;
% Sum m plane waves over [0,pi)
q = 0;
for a = (0:m-1)*pi/m
q = q+cos(x*cos(a)+x'*sin(a)+p);
end
% Set colormap blend ratio [0,1]
R = (1-cos(p/3))/2;
% Wrap output to [0,1] and apply colormap blend
imshow((cos(q+2)+1)/2, 'Border', 'tight', 'Colormap', R*hot+(1-R)*bone);
end
Movie
Audio

This submission does not have audio.

Remix Tree