function [ x, y ] = ll_degrees_to_xy ( n, lat, lon )

%*****************************************************************************80
%
%% ll_degrees_to_xy(): Latitude/Longitude in degrees to XY coordinates.
%
%  Discussion:
%
%    Essentially, the latitude and longitude information is treated
%    as though the Earth were a cylinder.  As long as the the
%    data is relatively close on the sphere (and far from either
%    pole) the distortion will not be too severe.  If the data
%    is closely clustered, and also near the equator, the
%    positions will be relatively accurate.
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    19 May 2016
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the number of data items.
%
%    real LAT(N), LON(N), the latitude and longitude, in degrees.
%
%  Output:
%
%    real X(N), Y(N), the point coordinates, in miles.
%
  radius = 3958.89;

  x = zeros ( n, 1 );
  y = zeros ( n, 1 );

  for i = 1 : n
    theta = degrees_to_radians ( lon[i] );
    phi = degrees_to_radians ( lat[i] );
    x[i] = radius * theta;
    y[i] = radius * phi;
  end

  return
end
