% explore Newton's iteration for z^3-1
g = -2:0.01:2;
[xx yy] = meshgrid(g,g); zz = xx+1i*yy;
f = @(z) z.^3 - 1;
fp = @(z) 3*z.^2;
figure;
for i=1:20
  zz = zz - f(zz)./fp(zz);
  imagesc(g,g,angle(zz)); axis equal; drawnow; pause(0.1);
end
