Pi is an infinite constant that appears in many definitions across physics and mathematics. Among its several definitions, it is the ratio of the circumference and diameter of any circle. Here is a short preview of \(\pi\):
[1] 3.1415926535897931
See the app here.
Given a circle with radius \(r\) inside a square like the one below generated with r:
The areas of the circle and the square are:
\[Area_{circle} = \pi * r ^{2}\] \[Area_{square} = 4 * r ^{2}\]
The probability of a random point falling in the circle is:
\[P(Point \ in \ Circle) = \frac {Area_{circle}}{Area_{square}} = \frac {\pi * r ^{2}} {4 * r ^{2}} = \frac {\pi} {4}\]
Therefore,
\[\pi = 4 * P(Point \ in \ Circle) = 4 * \frac {Area_{circle}}{Area_{square}}\] \[\pi = 4 *\frac {points \ in \ circle}{total \ points}\]
Each point is generated using an uniform distribution where: \[min = -radius\] \[max = radius\]
The circle coordinates are defined by: \[x = h + r * cos(\theta)\] \[y = k + r * sin(\theta)\] where,
The user is able to define five (5) parameters:
See the app here.