function triangle_ijk_in_region_test ( )

%*****************************************************************************80
%
%% triangle_ijk_in_region_test tests triangle_ijk_in_region().
%
%  Discussion:
%
%    5           x x x x-x x
%                 /|  / /
%    4         x-x x x x x
%             /    |/ /
%    3       x-x x x x x
%              |    /
%    2     x x x x x x
%             /    |
%    1   x-x-x x x x
%       /         /
%    0 x-x-x-x-x-x
%
%      0 1 2 3 4 5
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    05 September 2020
%
%  Author:
%
%    John Burkardt
%
  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'triangle_ijk_in_region_test\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  triangle_ijk_in_region() reports whether a triangle is\n' );
  fprintf ( 1, '  inside a polygonal region.\n' );

  imin = 0;
  imax = 5;
  jmin = 0;
  jmax = 5;

  iv = [ 0,5,5,4,4,3,3,1,1,0,0,1,2,2,0 ];
  jv = [ 0,0,1,2,5,5,3,5,4,4,3,3,2,1,1 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, '   i   j   k  inside?\n' );
  fprintf ( 1, '\n' );

  for j = jmin + 1 : jmax
    for i = imin + 1: imax
      for k = 0 : 1
        inside = triangle_ijk_in_region ( i, j, k, iv, jv );
        tf = boolean_to_string ( inside );
        fprintf ( 1, '  %2d  %2d  %2d  %s\n', i, j, k, tf );
      end
    end
  end
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'triangle_ijk_in_region_test\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  timestamp ( );

  return
end
