The method of using inscribed and circumscribed n-gons conceptually is the simplest (1), but converges very slowly. See https://arxiv.org/pdf/2008.07995.pdf.
(1) at least to non-mathematicians. Pure mathematicians will want to prove the claims that the circumference of a circle is larger than/smaller than that of its inscribed/circumscribed polygon and that both can get arbitrarily close to it if the number of sides gets large enough.
The more practical methods:
- Chudnovsky algorithm: https://youtu.be/LhlqCJjbEa0
- Newton's method: https://youtu.be/CKl1B8y4qXw?t=160
https://maa.org/sites/default/files/pdf/pubs/amm_supplements... A Spigot Algorithm for the Digits of π Author(s): Stanley Rabinowitz and Stan Wagon Source: The American Mathematical Monthly, Vol. 102, No. 3 (Mar., 1995), pp. 195-203
Fortran code for the algorithm is at https://fortran-lang.discourse.group/t/fortran-code-snippets...
#! pip install sympy gmpy
import sympy
sympy.evalf(sympy.pi)
sympy.N(sympy.pi)
https://docs.sympy.org/latest/modules/evalf.htmlRosettaCode > [Python] lists quite a few more: https://rosettacode.org/wiki/Pi#Python
dig into the links a bit