function polygon_contains_point_test ( )

%*****************************************************************************80
%
%% polygon_contains_point_test() tests polygon_contains_point().
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    19 January 2021
%
%  Author:
%
%    John Burkardt
%
  n = 5;
  test_num = 4;
 
  p = [ ...
    0.0, 0.0; ...
    1.0, 0.0; ...
    2.0, 1.0; ...
    1.0, 2.0; ...
    0.0, 2.0 ];

  q = [ ...
    1.0,  1.0; ...
    3.0,  4.0; ...
    0.1,  1.0; ...
    0.5, -0.25 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, 'polygon_contains_point_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  polygon_contains_point() determines if\n' );
  fprintf ( 1, '  a point Q is inside a polygon P.\n' );

  pn = size ( p, 1 );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Vertices of polygon P:\n' );
  fprintf ( 1, '\n' );
  for i = 1 : pn
    fprintf ( 1, '  %6d:   %12g  %12g\n', i, p(i,1:2) );
  end

  fprintf ( 1, '\n' );
  fprintf ( 1, '          Q          Inside?\n' );
  fprintf ( 1, '\n' );

  for i = 1 : test_num
  
    inside = polygon_contains_point ( p, q(i,1:2) );

    fprintf ( 1, '  (%8.4f,%8.4f)    %s\n', q(i,1:2), mat2str ( inside ) );

  end
 
  return
end
 
