Calculation of π in this project is proced using random generated numbers and relationship between field of a circle and a square. Knowing the fact that circle inscribed in square share the same length of diameter as the side of a square we can derive the formula of PI number which is:
Based on this formula we can calculate the approximate value of the number PI
In this program Pcircle and Psquare are the number of dots that are randomly placed either in circle field or square field.
Accuracy of calculated π number strictly depends on randomness of the generated random numbers