function result = hexagon01_monte_carlo ( n, f )

%*****************************************************************************80
%
%% hexagon01_monte_carlo: Monte Carlo estimate of integral over unit hexagon.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    25 April 2019
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer n, the number of sample points.
%
%    pointer f, the name of the function.
%
%  Output:
%
%    real result, the approximate integrals.
%
  area = hexagon01_area ( );

  [ x, y ] = hexagon01_sample ( n );

  result = ( area / n ) * sum ( f ( x, y ) );
  
  return
end
