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

%*****************************************************************************80
%
%% ll_degrees_to_xyz(): Latitude/Longitude in degrees to XYZ coordinates.
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    18 June 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), Z(N) the point coordinates, in miles.
%
  degrees_to_radians = pi / 180.0;

  lat = degrees_to_radians * lat;
  lon = degrees_to_radians * lon;

  r = 3958.89;
  
  x = r * cos ( lat ) * cos ( lon );
  y = r * cos ( lat ) * sin ( lon );
  z = r * sin ( lat );

  return
end
