function [pts, ind] = sort_region_pts(p)
pts = p;
if nargin<1
    return;
end
if size(p,2) ~=2
    return;
end
m = mean(p);
pt = p - ones(size(p,1),1)*m;
[theta, rad] = cart2pol(pt(:,1), pt(:,2));
[Y, ind] = sort(theta);
pts = p(ind,:);


