function gaussian_2d_test ( )

%*****************************************************************************80
%
%% gaussian_2d_test() tests gaussian_2d().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    18 February 2021
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../gaussian_2d' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'gaussian_2d_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  gaussian_2d() evaluates a general gaussian\n' );
  fprintf ( 1, '  function of a 2D argument.\n' );
%
  c = 1.0;

  [ X, Y ] = meshgrid ( -5:.1:5, -5:.1:5 );

  xmu = 0.0;
  ymu = 0.0;

  xsigma = 1.0;
  ysigma = 2.0;

  A = [ 5, 1; 
        1, 2 ];

  Z = gaussian_2d ( c, X, Y, xmu, ymu, xsigma, ysigma, A );

  surf ( X, Y, Z );
  shading ( 'interp' );
  view ( -36, 36 );
  xlabel ( '<--- X --->' );
  ylabel ( '<--- Y --->' );
  zlabel ( '<--- Z(X,Y) --->' );
  title ( 'Gaussian function Z(X,Y)' );

  filename = 'gaussian_2d.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'gaussian_2d_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  timestamp ( );

  rmpath ( '../gaussian_2d' );

  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

