- /
-
solar storms!
on 11 Nov 2023
- 8
- 17
- 0
- 0
- 588
drawframe(1);
Write your drawframe function below
function drawframe(f)
a = 500;
v = 255;
l = @linspace;
p = @rescale;
X = l(10, -10, a);
c = flip(cool);
c(:, 3) = l(1, .2, v + 1);
c(1, :) = [0 0 0];
[x, y] = meshgrid(X, (X - 10)');
[t, r] = cart2pol(X, X');
colormap(c);
skyColor = [f/50, f/50, f/50];
y(y < (.05 * (x + rand(1, a)).^2) - 15) = 0;
image(zeros(a));
hold on;
image(p(-y, 0, v), 'AlphaData', p(y .* abs(ifft2(r.^-2.2 .* cos(7 * rand(a)))) , 0, 1));
h=exp(-(r-12)).*abs(ifft2(r.^-1.8.*cos(10*rand(a))));
h(r<3)=1;
colormap(gray.*[1 .44 .2]);
image(v*zeros(a),'AlphaData',p(h,0,1))
camva(4)
hold on
h(r>3)=1;
image(v*zeros(a),'AlphaData',p(h,0,1))
camva(3.8)
hold off
hold off;
axis off
camva(3.8)
end