function finalspread = spread2d(M)

% Gives the ratio of the mean nearest neighbor distance to the diameter of a group (the largest
% interindividual distance.  Input M is an array of individuals in the standard indexed form.

mnnd = meanNND2d(M)
diam = diameter2d(M)
finalspread = mnnd/diam