- /
-
Newton garden 2
on 19 Oct 2021
- 8
- 8
- 0
- 0
- 269
N=200;
h=.001;
[X,Y]=meshgrid(linspace(-1,1,800),linspace(-1,1,800));
A=X(:)+i*Y(:);
S=1:numel(X);
I=N*ones(numel(X),1);
for i=1:N
k=A(S);
A(S)=k-(k.^2+1)./5.*(k).^3;
d=(k-A(S));
C=abs(d)<h;
prob=isnan(d);
I(S(C))=i;
I(S(prob))=N+1;
S(C|prob)=[];
end
imshow(reshape(I,size(X)),[])
colormap(colorcube)