function legendre01_to_bernstein_test ( )

%*****************************************************************************80
%
%% legendre01_to_bernstein_test() tests legendre01_to_bernstein().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    23 February 2024
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'legendre01_to_bernstein_test ( )\n' );
  fprintf ( 1, '  legendre01_to_bernstein() converts a\n' );
  fprintf ( 1, '  polynomial from Legendre01 form to\n' );
  fprintf ( 1, '  Bernstein form.\n' );

  nmax = 6;

  fprintf ( 1, '\n' );
  fprintf ( 1, '             ' );
  for k = 0 : nmax
    fprintf ( 'B%d(x)    ', k );
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, '\n' );
  for n = 0 : nmax
    lcoef = zeros ( n + 1, 1 );
    lcoef(n+1) = 1.0;
    bcoef = legendre01_to_bernstein ( n, lcoef );
    fprintf ( 1, 'P01%d(X) =  ', n );
    for k = 0 : n
      fprintf ( 1, '%8.5f ', bcoef(k+1) );
    end
    fprintf ( 1, '\n' );
  end

  return
end
