function dist_table = ll_degrees_to_dist ( n, lat, long )

%*****************************************************************************80
%
%% ll_degrees_to_dist() creates a distance table from latitudes and longitudes.
%
%  Discussion:
%
%    A distance function is used which is appropriate for the earth.
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    28 May 2016
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the number of data items.
%
%    real LAT(N), LONG(N), the latitude and longitude, 
%    in degrees.
%
%  Output:
%
%    real DIST_TABLE(N,N), the distance matrix.  Distances 
%    are measured in miles.
%
  dist_table = zeros ( n, n );

  for i = 1 : n
    for j = i + 1 : n
      dist_table(i,j) = ll_degrees_to_distance_earth ( lat(i), long(i), ...
        lat(j), long(j) );
      dist_table(j,i) = dist_table(i,j);
    end
  end

  return
end
