
% easy function to draw Julia sets of quadratic polynomials
% z^2 + c

function  julia1(c)
  tic
  x=[-2:.01:2];  % x coordinates
  y=[-2:.01:2];  % y coordinates
  depth=50; % how many iterations to try
  d=depth*ones(length(x),length(y));
  for k=1:length(x)
     for j=1:length(y) 
	z=x(k)+i*y(j);
	for t=1:depth
           if abs(z) > 4
             d(j,k)=t;
	     break;
           else
             z=z^2+c;
           end 
	end  % for t
     end  % for y
  end   % for x
  image(d); 
  %setc=flipud(jet(depth));
  %s=size(setc,1);
  %setc([s-1,s],:)=zeros(2,3);
  %colormap(setc)
  %colorbar
  toc
 return


