load f
volume = 1;

clear cfinal
if ~volume,
   thr = [0.1:0.1:0.9]';
   for i = 2 : length(thr),
   rand('seed',0);
   figure(1); 
   subplot(211);
   plot(zz(:,1),zz(:,2),'g.','markersize',6); hold on
	[f,v] = amerge(zz,10,[],0.01,2,thr2(i),[1 0]);
	cfinal(i) = size(v,1);
%   pause;
   end;
else
   thr = [0.0:0.01:0.1]';
   clear cfinal
   for i = 1 : length(thr),
   rand('seed',0);
   figure(1); 
   subplot(211);
   plot(zz(:,1),zz(:,2),'g.','markersize',6); hold on
   [f,v,P] = gkvol(zz,10,1.4,[],thr(i),1); hold off
	cfinal(i) = size(v,1);
%   pause;
   end;
end;

plot(thr,cfinal,'.-','linewidth',2,'markersize',20);

return

figure(1); 
subplot(211);
plot(zz(:,1),zz(:,2),'g.','markersize',6); 
%hold on
%[f,v,P] = gkvol(zz,10,[],[],0.1,1); hold off
[f,v] = amerge(zz,10,[],0.01,2,.3,[1 0]); hold on
plot(zz(:,1),zz(:,2),'g.','markersize',6); hold off

%plot(thr2,cfinal,'.-','linewidth',2,'markersize',20);


