function value = triangle_contains_ijk ( t, ijk )

%*****************************************************************************80
%
%% triangle_contains_ijk() determines if a triangle is in a region.
%
%  Discussion:
%
%    The triangle list is a list of the IJK parallelogram triangles
%    that constitute the polyiamond.
%
%    The (i,j) coordinates refer to a parallelogram whose basic cell
%    is the unit parallelogram outlined by points (A,B,C,D)
%    with (i,j) coordinates
%      A = (0,0) --> B = (1,0) --> C = (1,1) --> D = (0,1).
%
%         D-----C
%        /     /
%       /     /
%      A-----B
%
%    Each cell is divided into k=0 and k=1 triangles:
%
%         *-----*
%        / \ 1 /
%       / 0 \ /
%      *-----*
%
%    Triangles are identified by a related (i,j,k) coordinate based 
%    on the (i,j) coordinates of its vertices:
%      If k = 0, the "ijk" triangle has vertices (i-1,j-1), (i,j-1), (i-1,j).
%      If k = 1, the "ijk" triangle has vertices (i,j),     (i-1,j), (i,j-1).
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    03 November 2020
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer T(NT,3): the IJK coordinates of the triangles in the region.
%
%    integer IJK(3): the parallelogram triangle index.
%
%  Output:
%
%    logical VALUE: is true if the triangle is in the region.
%
  q = ismember ( ijk, t, 'rows' );
  value = ( 0 < q );
 
  return
end

