function monomial_to_gegenbauer_test ( )

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

  alpha = 0.5;
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Gegenbauer parameter = %g\n', alpha );

  nmax = 6;

  fprintf ( 1, '\n' );
  fprintf ( 1, '        ' );
  for k = 0 : nmax
    fprintf ( 'C%d(x)    ', k );
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, '\n' );
  for n = 0 : nmax
    mcoef = zeros ( n + 1, 1 );
    mcoef(n+1) = 1.0;
    gcoef = monomial_to_gegenbauer ( n, alpha, mcoef );
    fprintf ( 1, 'X^%d =  ', n );
    for k = 0 : n
      fprintf ( 1, '%8.5f ', gcoef(k+1) );
    end
    fprintf ( 1, '\n' );
  end

  return
end
