clear()

N=500;
M=50;

function siatka=siatka_zespolona(min_re,max_re,min_im,max_im)
    wektor_re=linspace(min_re,max_re,N);
    siatka_re=ones(wektor_re)'*wektor_re;
    
    wektor_im=linspace(min_im,max_im,N);
    siatka_im=(ones(wektor_im)'*wektor_im)';
    
    siatka=siatka_re +%i*siatka_im;    
endfunction

function z=rysuj_julie(c,min_re,max_re,min_im,max_im)
    
    z=siatka_zespolona(min_re,max_re,min_im,max_im);
     
    for i=1:M
        z=z.*z+c;
        z(abs(z)>=1000)=1000;
    end 
    
    z( abs(z)<1000 )  = 0.0;

    clf();       
    a=gca(); a.data_bounds=[min_re,min_im;max_re,max_im]; a.box="on";
    Matplot1(z, [min_re, min_im, max_re, max_im]);
endfunction
   
c=-0.9;

// Inne fajne parametry do przetestowania:
// c=-0.4 + %i*0.6
// c=-0.835 - %i*0.2321
// c= 0.2557;
 
z=rysuj_julie(c,-1.0,1.0,-1.0,1.0);
