This $\pi$ estimate is derived from Pick's theorem and the approximation of a circle with a lattice polygon
$$ \begin{equation*} \pi \approx \lim_{r\to\infty} \frac{i + \frac{b}{2} - 1}{r^2} \end{equation*} $$
To derive it, Pick's theorem states
$$ A = i + \frac{b}{2} - 1 $$
where $A$ is the area of the lattice polygon.
For a circle with radius $r$, the area is given by:
$$ A = \pi r^2 $$
When the lattice polygon closely approximates the circle, their areas $A$ are nearly equal:
$$ \pi r^2 \approx i + \frac{b}{2} - 1 $$
$$ \pi \approx \frac{i + \frac{b}{2} - 1}{r^2} $$
As $ r \to \infty $, the lattice polygon becomes an increasingly accurate representation of the circle, and the area ratio converges to the value of pi:
$$ \begin{equation*} \pi \approx \lim_{r\to\infty} \frac{i + \frac{b}{2} - 1}{r^2} \end{equation*} $$
Examples
For $r=10$, the estimated value of $\pi$ is $4.645000$
For $r=100$, the estimated value of $\pi$ is $3.156050$
For $r=10000$, the estimated value of $\pi$ is $3.141592$ (C Code)
Is this a valid method to estimate $\pi$?