function triangle_sample_test ( )

%*****************************************************************************80
%
%% TRIANGLE_SAMPLE_TEST tests TRIANGLE_SAMPLE.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    10 April 2007
%
%  Author:
%
%    John Burkardt
%
  seed = 123456789;
  t = [ ...
     4.0, 2.0; ...
     1.0, 5.0; ...
    -2.0, 2.0 ]';

  fprintf ( 1, '\n' );
  fprintf ( 1, 'TRIANGLE_SAMPLE_TEST\n' );
  fprintf ( 1, '  TRIANGLE_SAMPLE samples a triangle.\n' );

  r8mat_transpose_print ( 2, 3, t, '  Triangle vertices:' );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Sample points (X,Y) and (XSI1,XSI2,XSI3) coordinates:\n' );
  fprintf ( 1, '\n' );

  for i = 1 : 10

    [ p, seed ] = triangle_sample ( t, 1, seed );

    xsi = triangle_xy_to_xsi ( t, p );

    fprintf ( 1, '  %10f  %10f    %10f  %10f  %10f\n', p(1:2), xsi(1:3) );

  end

  return
end
