function quad_mesh_test11 ( )

%*****************************************************************************80
%
%% quad_mesh_test11() demonstrates sample_quad().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    22 February 2009
%
%  Author:
%
%    John Burkardt
%
  quad_xy = [ ...
    1.0, 2.0;
    5.0, 2.0;
    5.0, 3.0;
    4.0, 4.0 ]';

  fprintf ( 1, '\n' );
  fprintf ( 1, 'quad_mesh_test11():\n' );
  fprintf ( 1, '  sample_quad() computes N random points in a quadrilateral.\n' );
  fprintf ( 1, '  Write them to a file.\n' );

  n = 5000;

  xy = sample_quad ( quad_xy, n );

  output_filename = 'sample_quad.txt';

  r8mat_write ( output_filename, 2, n, xy );

  fprintf ( 1, '  Point coordinates written to "%s".\n', output_filename );

  return
end
