function dist = ll_degrees_to_distance_earth ( lat1, lon1, lat2, lon2 )

%*****************************************************************************80
%
%% LL_DEGREES_TO_DISTANCE_EARTH: distance between two points on the earth.
%
%  Discussion:
%
%    The positions of the points are given as longitude and
%    latitude, measured in degrees.
%
%    The distance is measured on the surface of the earth, which
%    is approximated by a sphere.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license. 
%
%  Modified:
%
%    19 May 2016
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, real LAT1, LON1, the latitude and longitude 
%    of the first point.  
%
%    Input, real LAT2, LON2, the latitude and longitude 
%    of the second point. 
%
%    Output, real DIST, the distance between the points, in miles.
%
  radius = 3958.89;

  lat1_rad = degrees_to_radians ( lat1 );
  lon1_rad = degrees_to_radians ( lon1 );

  lat2_rad = degrees_to_radians ( lat2 );
  lon2_rad = degrees_to_radians ( lon2 );

  theta = acos ( sin ( lat1_rad ) * sin ( lat2_rad ) ...
               + cos ( lat1_rad ) * cos ( lat2_rad ) ...
               * cos ( lon1_rad - lon2_rad ) );

  dist = radius * theta;

  return
end