function monomial_to_legendre_test ( )

%*****************************************************************************80
%
%% monomial_to_legendre_test() tests monomial_to_legendre().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    19 February 2024
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'monomial_to_legendre_test ( )\n' );
  fprintf ( 1, '  monomial_to_legendre() converts a\n' );
  fprintf ( 1, '  polynomial from monomial form to\n' );
  fprintf ( 1, '  Legendre form.\n' );

  nmax = 6;

  fprintf ( 1, '\n' );
  fprintf ( 1, '        ' );
  for k = 0 : nmax
    fprintf ( 'P%d(x)    ', k );
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, '\n' );
  for n = 0 : nmax
    mcoef = zeros ( n + 1, 1 );
    mcoef(n+1) = 1.0;
    lcoef = monomial_to_legendre ( n, mcoef );
    fprintf ( 1, 'X^%d =  ', n );
    for k = 0 : n
      fprintf ( 1, '%8.5f ', lcoef(k+1) );
    end
    fprintf ( 1, '\n' );
  end

  return
end
