function contour_gradient_3d_test ( )

%*****************************************************************************80
%
%% CONTOUR_GRADIENT_3D_TEST tests CONTOUR_GRADIENT_3D.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    02 January 2019
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../contour_gradient_3d' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'CONTOUR_GRADIENT_3D_TEST\n' );
  fprintf ( 1, '  MATLAB version\n.\n' );
  fprintf ( 1, '  Test CONTOUR_GRADIENT_3D\n' );

  xmin = - 3.0;
  xmax = + 3.0;
  nx = 20;

  ymin = -3.0;
  ymax = +3.0;
  ny = 20;

  contour_gradient_3d ( xmin, xmax, nx, ymin, ymax, ny, @f );

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

  rmpath ( '../contour_gradient_3d' );

  return
end
function Z = f ( X, Y )

%*****************************************************************************80
%
  Z = 0.5 * ( 3 * X.^2 + 4 * X .* Y + 6 * Y.^2 ) - 2 * X + 8 * Y + 50;

  return
end
