function triangle_reference_sample_test ( )

%*****************************************************************************80
%
%% TRIANGLE_REFERENCE_SAMPLE_TEST tests TRIANGLE_REFERENCE_SAMPLE.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    09 November 2015
%
%  Author:
%
%    John Burkardt
%
  seed = 123456789;
  t = [ ...
     0.0, 0.0; ...
     1.0, 0.0; ...
     0.0, 1.0 ]';

  fprintf ( 1, '\n' );
  fprintf ( 1, 'TRIANGLE_REFERENCE_SAMPLE_TEST\n' );
  fprintf ( 1, '  TRIANGLE_REFERENCE_SAMPLE samples the reference 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_reference_sample ( 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
