• Remix
  • Share
  • New Entry

  • Adam

  • /
  • Mandelbrot zoom

on 21 Oct 2024
  • 34
  • 257
  • 1
  • 0
  • 413
Cite your audio source here (if applicable):
drawframe(1);
Write your drawframe function below
function drawframe(f)
n = 750;
max_iter = 300;
% Set the zooming area for Seahorse Valley
x_center = -0.7434492;
y_center = 0.1313851;
zoom_factor = 1 / (2^(f/4));
xlim = [x_center - zoom_factor, x_center + zoom_factor];
ylim = [y_center - zoom_factor, y_center + zoom_factor];
% Create grid of complex numbers
x = linspace(xlim(1), xlim(2), n);
y = linspace(ylim(1), ylim(2), n);
[X, Y] = meshgrid(x, y);
Z = X + 1i * Y;
M = zeros(size(Z));
C = Z;
for k = 1:max_iter
Z = Z.^2 + C;
M(abs(Z) > 2 & M == 0) = k; % Assign iteration count to diverging points
end
% Display the fractal image
imagesc(x, y, M)
colormap(hot) % Choose a colormap
end
Movie
Audio

This submission does not have audio.

Remix Tree