function inregion_test ( )

%*****************************************************************************80
%
%% inregion_test tests inregion.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    06 January 2020
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'inregion_test\n' );
  fprintf ( 1, '  Test inregion.\n' );

  xv = [-3 -3 1 1 3 1 -1 -1 -3];
  yv = [-3 -1 3 1 1 -1 -1 -3 -3];
  [x,y] = meshgrid(-3:1/2:3);
  [in,on] = inregion(x,y,xv,yv);
  p = find(in-on);
  q = find(on);
  plot(xv,yv,'-',x(p),y(p),'ko',x(q),y(q),'ro');
  axis([-5 5 -4 4]);
  grid ( 'on' );

  filename = 'inregion_test.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  return
end

