function interp_trig_test ( )

%*****************************************************************************80
%
%% interp_trig_test() tests interp_trig().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    29 June 2019
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Kendall Atkinson, Weimin Han,
%    Elementary Numerical Analysis,
%    Wiley, 2004,
%    ISBN: 0471433373,
%    LC: QA297.A83.2004.
%
  addpath ( '../interp_trig' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'interp_trig_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Test interp_trig():\n' );

  a = 0.0;
  b = 2.0;
  n = 11;
  [ xp, yp ] = interp_trig ( 'humps_fun(x)', a, b, n );

  x = linspace ( a, b, n + 1 );
  x = x(1:n)
  y = humps_fun ( x );

  yt = humps_fun ( xp );

  clf ( );
  hold ( 'on' );
  plot ( xp, yt, 'b-', 'linewidth', 3 );
  plot ( xp, yp, 'r-', 'linewidth', 3 );
  plot ( x, y, '.', 'markersize', 25 );
  legend ( 'True function', 'Interpolant', 'Data' );
  grid ( 'on' );
  hold ( 'off' );
  filename = 'humps_trig.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
  pause ( 5.0 );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'interp_trig_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  timestamp ( );

  rmpath ( '../interp_trig' );

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the current YMDHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  t = now;
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end

