else plot([x_bound;x_bound(1)],[y_bound;y_bound(1)],'-k','linewidth',2) end for ii=1:size(vx,1) plot(vx(ii,:),vy(ii,:),'-b','linewidth',2) end for ii=1:size(kx,1) plot(kx(ii,:),ky(ii,:),'-b','linewidth',2) end hold off axis([xmin,xmax,ymin,ymax]) title('Perpendicular Bisectors') end % Figure 4: Voronoi Regions N_taps=size(P,1); c_map=jet(N_taps); figure for ii=1:N_taps % Plot tributary areas with holes if any(isnan(x_trib{ii}))&&P_inl(ii) [patch_f,patch_v]=poly2fv(x_trib{ii},y_trib{ii}); ind=find(isnan(x_trib{ii})); % Plot tributary areas without holes elseif P_inl(ii) patch(x_trib{ii},y_trib{ii},c_map(ii,:),'linewidth',2,'FaceAlpha',0.5); end end hold on % Plot taps plot(P(P_inl,1),P(P_inl,2),'ok') plot(P(~P_inl,1),P(~P_inl,2),'xk') % Plot surface bounds if any(isnan(x_bound)) ind=find(isnan(x_bound)); else plot([x_bound;x_bound(1)],[y_bound;y_bound(1)],'-k','linewidth',2) end hold off axis([xmin,xmax,ymin,ymax]) title('Voronoi Regions')
else plot([x_bound;x_bound(1)],[y_bound;y_bound(1)],'-k','linewidth',2) end for ii=1:size(vx,1) plot(vx(ii,:),vy(ii,:),'-b','linewidth',2) end for ii=1:size(kx,1) plot(kx(ii,:),ky(ii,:),'-b','linewidth',2) end hold off axis([xmin,xmax,ymin,ymax]) title('Perpendicular Bisectors') end % Figure 4: Voronoi Regions N_taps=size(P,1); c_map=jet(N_taps); figure for ii=1:N_taps % Plot tributary areas with holes if any(isnan(x_trib{ii}))&&P_inl(ii) [patch_f,patch_v]=poly2fv(x_trib{ii},y_trib{ii}); ind=find(isnan(x_trib{ii})); % Plot tributary areas without holes elseif P_inl(ii) patch(x_trib{ii},y_trib{ii},c_map(ii,:),'linewidth',2,'FaceAlpha',0.5); end end hold on % Plot taps plot(P(P_inl,1),P(P_inl,2),'ok') plot(P(~P_inl,1),P(~P_inl,2),'xk') % Plot surface bounds if any(isnan(x_bound)) ind=find(isnan(x_bound)); else plot([x_bound;x_bound(1)],[y_bound;y_bound(1)],'-k','linewidth',2) end hold off axis([xmin,xmax,ymin,ymax]) title('Voronoi Regions')