function triangle_contains_test ( )

%*****************************************************************************80
%
%% triangle_contains_test() tests triangle_contains().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    29 July 2023
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'triangle_contains_test():\n' );
  fprintf ( 1, '  triangle_contains() reports whether a point P\n' );
  fprintf ( 1, '  is contained in a triangle T.\n' );

  t = [ 4, 0; ...
        3, 4; ...
        0, 1 ];

  p_test = [ 1, 4;
        2, 1;
        2, 3;
        3, 2;
        3, 4;
        3, 5;
        4, 1;
        4, 5 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Triangle vertices:\n' );
  disp ( t );

  fprintf ( 1, '\n' );
  fprintf ( 1, '      P      contained?\n' );
  fprintf ( 1, '\n' );

  for i = 1 : 8
    p = p_test(i,1:2);
    contains = triangle_contains ( t, p );
    fprintf ( 1, '  %10f  %10f  %s\n', p, mat2str ( contains ) );
  end

  return
end
