"A method that is easier to understand and does not make the use of sin function is based on the fact that if $X\\sim \\mathbf{U}(0, 1)$ and $Y\\sim \\mathbf{U}(0, 1)$, then $P[X^2 + Y^2 \\leq 1] = \\pi/4$ (See [\"Monte Carlo Method\" on Wikipedia](https://en.wikipedia.org/wiki/Monte_Carlo_method)). The following code used the approach:"