function polygon_convex_random_test ( )

%*****************************************************************************80
%
%% polygon_convex_random_test() tests polygon_convex_random().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    25 November 2024
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'polygon_convex_random_test():\n' );
  fprintf ( 1, '  polygon_convex_random() creates a random convex polygon\n' );
  fprintf ( 1, '  using the Minkowski representation.\n' );
  n = 7;
  fprintf ( 1, '  Generating polygons with %d nodes\n', n );

  for test = 1 : 3

    v = polygon_convex_random ( n );

    clf ( );
    hold ( 'on' );
      for i = 1 : n
        label = sprintf ( '%d', i );
        text ( v(i,1), v(i,2)+0.1, label );
      end
      plot ( v(:,1), v(:,2), 'b.', 'markersize', 30 );
%
%  Copy first node to last, to close plot.
%
      v = [ v; v(1,1:2) ];
      plot ( v(:,1), v(:,2), 'r-', 'linewidth', 2 );
    hold ( 'off' );
    axis ( 'equal' )
    title ( sprintf ( 'polygon convex random #%d', test ) );
    grid ( 'on' );
    filename = sprintf ( 'polygon_convex_random_%d.png', test );
    print ( '-dpng', filename );
    fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  end

  return
end

