- /
-
Dragon under the microscope
on 30 Nov 2023
- 4
- 14
- 0
- 0
- 324
drawframe(1);
Write your drawframe function below
function drawframe(f)
c = -0.826175 + 0.801476*1i;
c = c*exp(pi*1i/48*f);
[X,Y] = meshgrid(-3:0.01:3,-2:0.01:2);
R = 2;
f = @(z) c*(z-sign(real(z)));
S = zeros(size(X));
z = X + 1i*Y;
selected = true(size(S));
for i=1:40
z = f(z);
selected = selected & (abs(z)<=R);
S(selected) = S(selected)+1;
end
imagesc(Y(:,1),X(1,:),flipud(S).^0.1); axis square off; colormap(turbo)
end