Julia set: maps with complex numbers

The Julia set is the points on the complex plane that remain bounded under iteration of the map for some complex number .

This code is adapted from the book "MATLAB Guide" by Desmond J. Higham and Nicholas J. Higham (the constant c and the region used to generate the region are more customized).

The examples are take from the book A first course in chaotic dynamical systems by Robert L. Devalney.

Julia Set "Dragon" with

x = linspace(-1.3,1.3,501);

y = linspace(-1.3,1.3,501);

[X,Y] = meshgrid(x,y);

c = 0.360284+0.100376*1i;

C = ones(size(X))*c;

Z_max = 1e6; it_max = 50;

Z = complex(X,Y);

B = zeros(size(C));

for k = 1:it_max

Z = Z.^2 + C;

B = B + (abs(Z)<2);

end

% only show those bounded points

imagesc(B);

colormap(jet);

title('Julia Set "Dragon" for $c=0.360284+0.100376i$','FontSize',16,'interpreter','latex');

axis off

Julia Set with

x = linspace(-1.6,1.6,501);

y = linspace(-1.3,1.3,501);

[X,Y] = meshgrid(x,y);

c = -0.75+0.1i;

C = ones(size(X))*c;

Z_max = 1e6; it_max = 50;

Z = complex(X,Y);

B = zeros(size(C));

for k = 1:it_max

Z = Z.^2 + C;

B = B + (abs(Z)<0.6);

end

imagesc(B);

colormap(jet);

title('Julia Set for $c=-0.75+0.1i$','FontSize',16,'interpreter','latex');

axis off