1 function poly_list = make_poly(x,y,rounds)
2 %x,y lists of points, column vectors
3 %fills in extra points along a ploygon
6 c = [mean(x) mean(y)];% center point
7 v = p-c ; % vectors connecting the central point and the given points
8 th = atan2(v(:,2),v(:,1));
9 [th, idx] = sort(th); % sort angles
10 p = p(idx,:); % sorting the given points
12 % figure,plot( p(:,1), p(:,2), '.-r');
13 % hold on,scatter(p(:,1),p(:,2),'*k'),hold off
22 px = 0.5*(p(i,1)+p(i-1,1));
23 py = 0.5*(p(i,2)+p(i-1,2));
27 %c = [mean(p(:,1)) mean(p(:,2))]; % mean/ central point
28 v = p-c ; % vectors connecting the central point and the given points
29 th = atan2(v(:,2),v(:,1)); % angle above x axis
30 [th, idx] = sort(th); % sorting the angles
31 % figure,plot( p(:,1), p(:,2), '.-r');
32 % hold on,scatter(p(:,1),p(:,2),'*k'),hold off
34 %p = unique(p,'rows');