function mapledet
% mapledet Deteriministinis klevo lapo fraktalinis pieshimas,
% pagal M.F. Barnsley, L.P. Hurd,
% fractal Image Compression, A.K. Peters Ltd., 1993

N=16; x=[]; y=[];
for i=1:4; x=[x i*ones(1,N-i+1)]; y=[y (i:N)]; end;
for i=1:4; y=[y i*ones(1,N-i+1)]; x=[x (i:N)]; end;
x=x*8; y=-y*8; 
figure(1); plot(x,-y,'k.'); axis off; title('Klevo lapas, iteracija=0');
w=zeros(4,6); m=100;
w(1,:)=[ 49   1  25*m   0 62 -2*m]/m;
w(2,:)=[ 27  52   0*m -40 36 56*m]/m;
w(3,:)=[ 18 -73  88*m  50 26  8*m]/m;
w(4,:)=[  4  -1  52*m  50  0 32*m]/m;
for k=1:6, 
 px=zeros(4,length(x)); py=zeros(4,length(y)); 
 for i=1:4,
 p=[w(i,1:2); w(i,4:5)]*[x;y]; px(i,:)=p(1,:)+w(i,3); py(i,:)=p(2,:)+w(i,6); end;
 x=[px(1,:) px(2,:) px(3,:) px(4,:)];
 y=[py(1,:) py(2,:) py(3,:) py(4,:)];
figure(k+1); clf; plot(x,-y,'k.','markersize',3); axis off; 
title(['Klevo lapas, iteracija=' num2str(k)]);
end;
