function triangle_contains_point_test ( )

%*****************************************************************************80
%
%% triangle_contains_point_test() tests triangle_contains_point().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    07 June 2006
%
%  Author:
%
%    John Burkardt
%
  test_num = 7;

  p_test = [ ...
     0.25,   0.25; ...
     0.75,   0.25; ...
     1.00,   1.00; ...
    11.00,   0.50; ...
     0.00,   1.00; ...
     0.50, -10.00; ...
     0.60,   0.60 ];

  t = [ ...
    0.0, 1.0; ...
    0.0, 0.0; ...
    1.0, 0.0 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, 'triangle_contains_point_test():\n' );
  fprintf ( 1, '  triangle_contains_point() reports if a point \n' );
  fprintf ( 1, '  is inside a triangle\n' );

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

  fprintf ( 1, '\n' );
  fprintf ( 1, '     X       Y     Inside\n' );
  fprintf ( 1, '\n' );

  for i = 1 : test_num

    p = p_test(i,1:2);

    inside = triangle_contains_point ( t, p );

    fprintf ( 1, '  %10f  %10f  %s\n', p, mat2str ( inside ) );

  end
 
  return
end
