%Benadert de Juliaset van f(z) = z^2 +c.
%initialisatie
step = 1000;
MAXITER=300;
c = sqrt(2)*1i - 1/sqrt(3)+ 0.0003453254;

%Window
xmin=-2;
xmax =2;
ymin =-2;
ymax = 2;

%coordinaatgrid
z = ones(step+1,1)*(xmin:(xmax-xmin)/step:xmax);
Romeo = transpose(ones(step+1,1)*(ymin:(ymax-ymin)/step:ymax));
z = z + 1i*Romeo;
Juliaset = zeros(step+1);

%main loop
for n=1:MAXITER
    z = z.^2 + c;
    Juliaset = Juliaset + (~Juliaset).*(abs(z)>2)*n;
end
Juliaset = Juliaset+MAXITER * (~Juliaset);

%plotting & saving
h=figure();
imagesc(Juliaset)
saveas(h,'picture1','fig')