function inregion_test ( )

%*****************************************************************************80
%
%% inregion_test() tests inregion()
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'inregion_test():\n' );
  fprintf ( 1, '  inregion() reports whether a point is inside or on\n' );
  fprintf ( 1, '  the boundary of a polygonal region.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Blue points inside, red points on boundary.\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);

  hold ( 'on' );
  plot ( x, y, 'k.' );
  plot(xv,yv,'-',x(p),y(p),'bo',x(q),y(q),'ro');
  axis([-5 5 -4 4]);
  hold ( 'off' );

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

  return
end
