From: Computation Physics, Landau, Paez, and Bordeianu, Wiley-VCH 2015.
This program illustratesthe use of Monte Carlo methods to calculate areas. It is possible to check the results that you get with the well-known values of some simple geometrical figures. The applet lets you change the number of the randomly generated points as well as the size of the figures.
Instructions:
- The vertical Scroll bar handles the size of the figure. The exact value of the area is kept in the variable 'a' and you can see it at the right.
- The number of points the simulation works with is controlled by the horizontal Scroll bar and its value is assigned to 'n'.
- From Figure list you can choose the shape of the geometrical figure.
- Once you have picked out the figure, the size and the number of points you are interested in, press the Run button to run the program.
- The program shows the points generated and prints two values: the number of points that are inside the figure, m, and the area, A, calculated from the relation between m and n.