function point_xy = dms_to_xy ( n, lat_dms, lon_dms )

%*****************************************************************************80
%
%% DMS_TO_XY: converts Latitude/Longitude in DMS 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 GNU LGPL license. 
%
%  Modified:
%
%    19 May 2016
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer N, the number of data items.
%
%    Input, integer LAT_DMS(4,N), LON_DMS(4,N), the latitude and
%    longitude, in degrees, minutes, and seconds, for each point.
%    The fourth argument is +1/-1 for North/South latitude or 
%    East/West longitude.
%
%    Output, real POINT_XY(2,N), the point coordinates, in miles.
%
  radius = 3958.89;

  point_xy = zeros ( 2, n );

  for j = 1 : n
    theta = dms_to_radians ( lon_dms(1:4,j) );
    phi = dms_to_radians ( lat_dms(1:4,j) );
    point_xy(1,j) = radius * theta;
    point_xy(2,j) = radius * phi;
  end

  return
end