function value = triangulation_area ( node_num, node_xy, element_order, ...
  element_num, element_node )

%*****************************************************************************80
%
%% triangulation_area() computes the area of a triangulation.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    26 December 2011
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer NODE_NUM, the number of nodes.
%
%    real NODE_XY(2,NODE_NUM), the coordinates of the nodes.
%
%    integer ELEMENT_ORDER, the order of the triangles.
%
%    integer ELEMENT_NUM, the number of triangles.
%
%    integer ELEMENT_NODE(ELEMENT_ORDER,ELEMENT_NUM),
%    the nodes making up each triangle.
%
%  Output:
%
%    real VALUE, the area.
%
  value = 0.0;

  for element = 1 : element_num

    element_xy(1:2,1:3) = node_xy(1:2,element_node(1:3,element));

    element_area = 0.5 * abs ( ...
        element_xy(1,1) * ( element_xy(2,2) - element_xy(2,3) ) ...
      + element_xy(1,2) * ( element_xy(2,3) - element_xy(2,1) ) ...
      + element_xy(1,3) * ( element_xy(2,1) - element_xy(2,2) ) );

    value = value + element_area;

  end

  return
end
