function cdf = centroidDistanceFourier(P,n,show)
%CENTROIDDISTANCEFOURIER(P,n,<show>) fft of centroid distance function of polygon p
%at n sample points
%function returns real vector of length n/2 - 1 (normalized amplitude value)
%if optional parameter 'show' exists, fft is plotted

cd=centroidDistance(P,n);
fourier=abs(fft(cd,n));
cdf=fourier(2: floor(n/2)) ./ fourier(1);

if exist('show')
   stairs(cdf);
end