function uniform_in_triangle_bad_test ( )

%*****************************************************************************80
%
%% uniform_in_triangle_bad_test() tests uniform_in_triangle_bad().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    12 January 2025
%
%  Author:
%
%    John Burkardt
%
  n = 1500;

  v1 = [ 0.75, 0.90 ];
  v2 = [ 0.00, 0.20 ];
  v3 = [ 0.95, 0.65 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, 'uniform_in_triangle_bad_test():\n' );
  fprintf ( 1, '  uniform_in_triangle_bad() is a "bad" algorithm intended\n' );
  fprintf ( 1, '  to produce uniform random points in a triangle.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Number of points N =          %12d\n', n );
  fprintf ( 1, '  V1 = %12f  %12f\n', v1(1:2) );
  fprintf ( 1, '  V2 = %12f  %12f\n', v2(1:2) );
  fprintf ( 1, '  V3 = %12f  %12f\n', v3(1:2) );
%
%  Compute the points.
%
  p = uniform_in_triangle_bad ( n, v1, v2, v3 );
%
%  Plot.
%
  clf ( );
  hold ( 'on' );
  plot ( [ v1(1), v2(1), v3(1), v1(1) ], ...
         [ v1(2), v2(2), v3(2), v1(2) ], 'r-', 'linewidth', 3 );
  plot ( p(:,1), p(:,2), 'r.', 'markersize', 10 );
  hold ( 'off' );
  xlabel ( '<--- X --->' );
  ylabel ( '<--- Y --->' );
  title ( 'uniform\_in\_triangle\_bad()' );
  grid ( 'on' );
  axis ( 'equal' );
  filename = 'uniform_in_triangle_bad.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  return
end
