function uniform_on_hemisphere_phong_test ( )

%*****************************************************************************80
%
%% uniform_on_hemisphere_phong_test() tests uniform_on_hemisphere_phong().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    11 April 2022
%
%  Author:
%
%    John Burkardt
%
  n = 500;
  m = 2;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'uniform_on_hemisphere_phong_test():\n' );
  fprintf ( 1, '  uniform_on_hemisphere_phong() maps uniform \n' );
  fprintf ( 1, '  points onto the unit hemisphere with Phong density.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Number of points N =    %12d\n', n );
  fprintf ( 1, '  Phong exponent M =      %12d\n', m );

  p = uniform_on_hemisphere_phong ( n, m );
%
%  Make a plot.
%
  clf ( );
  scatter3 ( p(:,1), p(:,2), p(:,3), 'b', 'filled' );
  grid ( 'on' );
  axis ( 'equal' );
  xlabel ( '<--- X --->' );
  ylabel ( '<--- Y --->' );
  zlabel ( '<--- Z --->' );
  title ( 'uniform\_on\_hemisphere\_phong()' );
  filename = 'uniform_on_hemisphere_phong.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s".\n', filename );

  return
end
