function radians = dms_to_radians ( dms )

%*****************************************************************************80
%
%% dms_to_radians() converts degrees, minutes, seconds to radians.
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    19 May 2016
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer DMS(4), the measurement of an angle in
%    degrees, minutes and seconds.  The fourth
%    argument is +1/-1 for North/South latitude or East/West longitude.
%
%  Output:
%
%    real RADIANS, the measurement of the same angle in radians.
%
  radians = ( dms(3) + 60 * dms(2) + 3600 * dms(1) ) / 3600.0;

  radians = pi * radians / 180.0;

  if ( dms(4) < 0 )
    radians = - radians;
  end

  return
end
