function legendre_to_monomial_test ( )

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

  nmax = 6;

  fprintf ( 1, '\n' );
  fprintf ( 1, '           ' );
  for k = 0 : nmax
    fprintf ( 1, 'X^%d     ', k );
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, '\n' );

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

  return
end
