function contains = triangle_contains ( t, p )

%*****************************************************************************80
%
%% triangle_contains() determines whether a triangle T contains a point P.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    29 July 2023
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real t(3,2): the triangle vertices.
%
%    real p(2): the point.
%
%  Output:
%
%    logical contains: true if the point P is inside triangle T.
%
  contains = line_side ( t(1,1:2), t(2,1:2), p ) && ...
             line_side ( t(2,1:2), t(3,1:2), p ) && ...
             line_side ( t(3,1:2), t(1,1:2), p );

  return
end
