function point_in_polygon_test ( )

%*****************************************************************************80
%
%% point_in_polygon_test tests point_in_polygon.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    05 September 2020
%
%  Author:
%
%    John Burkardt
%
  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'point_in_polygon_test\n' );
  fprintf ( 1, '  point_in_polygon() determines if \n' );
  fprintf ( 1, '  a point is in a polygon.\n' );

  ntest = 4;

  px = [ 1.0,  3.0,  0.0,  0.5 ];
  py = [ 1.0,  4.0,  2.0, -0.25 ];

  vx = [ 0.0, 1.0, 2.0, 1.0, 0.0 ];
  vy = [ 0.0, 0.0, 1.0, 2.0, 2.0 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Polygon vertices:\n' );
  fprintf ( 1, '\n' );
  for i = 1 : length ( vx )
    fprintf ( 1, '  %d:  %f  %f\n', i, vx(i), vy(i) );
  end

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

  for i = 1 : ntest
  
    inside = point_in_polygon ( px(i), py(i), vx, vy );
    tf = boolean_to_string ( inside );
    fprintf ( 1, '  %12f  %12f  %s\n', px(i), py(i), tf );

  end
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'point_in_polygon_test\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  timestamp ( );
 
  return
end
