# How can i calculate pi

## Calculate circle number Pi / formulas + algorithms

The calculations on circles are one of the oldest problems in mathematics. Be it the circumference or the area, people have been trying to elicit the secrets of the circle and its wondrous circle constant for thousands of years. In the beginning it was only rough approximations for Pi, but this has changed significantly with Archimedes' method. Finally there was a technique for calculating the Circle number Pi, which allowed the numerical value of π to be given with greater precision.

### How do you calculate pi?

Due to its transcendence and irrationality, it has long been known that π not only represents an infinitely long sequence of numbers, but that there can also be no simple formula for Pi that only derives the value of PI from the radius or the diameter and a few divisions and multiplications calculated. On the other hand, formulas and algorithms have been discovered that are amazingly simple and elegant. But all of these formulas have one thing in common. Without heavy arithmetic there is no wage. Fortunately, since the middle of the twentieth century, modern arithmetic servants have been doing this for us. But it all started over 2000 years ago with Archimedes of Syracuse.

### Archimedes method / exhaustion method

Archimedes chose a geometric approach for his calculation of pi. Starting with two regular hexagons, which were circumscribed or inscribed in a unit circle (circle with radius 1), it worked its way over 12-, 24- and 48-corners up to two 96-corners. He calculated their circumference with the help of the other interim results and thus finally found a lower and an upper limit for their circumference and thus also for the number pi. With the help of the area of ​​the circle, Archimedes would have come to similar results, with probably slightly weaker bounds.

This means that pi was calculated exactly to 2 decimal places and 3.14 was established as the first approximate value of pi for centuries. A strong leadership, because more than the Pythagorean theorem and the Thales theorem and a few very elementary geometrical rules were not available to Archimedes.

### Calculate pi with infinite series of numbers

Perhaps the most beautiful and amazing formula for calculating pi is the so-called Leibniz series. It is attributed to Gottfried Wilhelm Leibniz, but is said to have been used much earlier in India.

The series is a special case of the arctangent series (π / 4 = arctan 1). However, due to its poor convergence, it is extremely unsuitable as a calculation formula. Over time, mathematicians created many more suitable variations of the arctangent series that could be used to calculate pi to billions of digits.
With the above formula, its discoverer John Machin calculated 100 digits of pi by hand in 1706.

One of the early Indian pi formulas is shown below:
The formula goes back to the Indian mathematician and astronomer Kelallur Nilakantha Somayaji (1444-1544) and does not converge very quickly, but funnily enough the summed up fractions calculate exactly the decimal places of pi, the 3 runs away in front

The following two formulas go back to the great mathematician Leonhard Euler. Although a little more complicated due to the need to pull a root, they are of a special elegance.

A significantly more complicated, but much faster converging and therefore much more suitable series expansion for calculating pi came from the Indian math genius S. Ramanujan.