- /
-
clear water waves 2100
on 26 Oct 2021
- 1
- 27
- 0
- 0
- 279
N=300;
s='same';
H=randn(N);
y=1:N;
r=@round;
k=zeros(N);
k(r(rand(4)*N^2))=1;
k=conv2(k,ones(29),s)<1;
for n=1:3e3
d=gradient(H);
g=(d+1)/6;
m=mod(r(y+randn(N).*k*4),N)+1;
o=mod(r(y'+(9-9*d).*k),N)+1;
H=conv2(H-g+accumarray([o(:),m(:)],g(:),[N,N]),ones(3)/9,s);
end
imagesc(diff(H))
axis off
colormap(winter)