function uniform_in_parallelogram_test ( )

%*****************************************************************************80
%
%% uniform_in_parallelogram_test() tests uniform_in_parallelogram().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    13 April 2022
%
%  Author:
%
%    John Burkardt
%
  n = 1000;
  v1 = [ 0.75, 0.90 ];
  v2 = [ 0.00, 0.20 ];
  v3 = [ 1.50, 0.65 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, 'uniform_in_parallelogram_test():\n' );
  fprintf ( 1, '  uniform_in_parallelogram() maps uniform\n' );
  fprintf ( 1, '  points into an arbitrary parallelogram.\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) );
  fprintf ( 1, '  V4 = %12f  %12f\n', v3(1:2)+v2(1:2)-v1(1:2) );

  p = uniform_in_parallelogram ( n, v1, v2, v3 );
%
%  Make a plot.
%
  clf ( );
  plot ( p(:,1), p(:,2), 'b.' );
  grid ( 'on' );
  axis ( 'equal' );
  xlabel ( '<--- X --->' );
  ylabel ( '<--- Y --->' );
  title ( 'uniform\_in\_parallelogram()' );
  filename = 'uniform_in_parallelogram.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s".\n', filename );

  return
end
