function legendre_theta_test ( )

%*****************************************************************************80
%
%% legendre_theta_test() tests legendre_theta().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    06 January 2016
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Ignace Bogaert,
%    Iteration-free computation of Gauss-Legendre quadrature nodes and weights,
%    SIAM Journal on Scientific Computing,
%    Volume 36, Number 3, 2014, pages A1008-1026.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'LEGENDRE_THETA_TEST:\n' );
  fprintf ( 1, '  LEGENDRE_THETA returns the K-th theta value for\n' );
  fprintf ( 1, '  a Gauss Legendre rule of order L.\n' );

  for l = 1 : 10
    fprintf ( 1, '\n' );
    fprintf ( 1, '  Gauss Legendre rule of order %d\n', l );
    fprintf ( 1, '\n' );
    fprintf ( 1, '   K       Theta      Cos(Theta)\n' );
    fprintf ( 1, '\n' );
    for k = 1 : l
      theta = legendre_theta ( l, k );
      fprintf ( 1, '  %2d  %14.6g  %14.6g\n', k, theta, cos ( theta ) );
    end
  end

  return
end
