function plotcentroiddistance(cdf,perimeter)
%PLOTCENTROIDDISTANCE(cdf,<perimeter>) plots centroid distance function
%if perimeter of original polygon is given, the figure is scaled

if exist('perimeter')==0
   plot(cdf)
else
   number=length(cdf);
   plot(perimeter/number*[1:number], cdf)
   axis equal
   grid on
end

   
