triangle01_monte_carlo, a MATLAB code which uses the Monte Carlo method to estimate the integral of a function F(X,Y) over the interior of the unit triangle in 2D.
The interior of the unit triangle in 2D is defined by the constraints:
0 <= X 0 <= Y X + Y <= 1The functions F(X,Y) are monomials, having the form
F(X,Y) = X^E(1) * Y^E(2)where the exponents are nonnegative integers.
The information on this web page is distributed under the MIT license.
triangle01_monte_carlo is available in a C version and a C++ version and a Fortran90 version and a MATLAB version and an Octave version and a Python version.
matlab_monte_carlo, a MATLAB code which uses Monte Carlo sampling to estimate areas and integrals.