Inspired by this post on Reddit, I wrote this little script to do the same thing. The circle is an illusion created by 100 straight-line tangents to an invisible circle. The tangents are created by drawing a chord in a larger concentric circle, and moving it’s endpoints around by equal increments 100 times. The larger circle’s circumference is defined by x=sin(t), y=cos(t), for t in the range 0 to 2*pi. So a chord’s endpoints will be defined by 2 different values of t.

- Import turtle & math libraries
- Set r (radius) to 400 px.
- Set angular increment to a 100th of the circle, i.e. 2*pi/100
- Initialise the plotting angle to to 0, and an offset to something in the range 0:2*pi
- Make 100 steps around the circle
- compute endpoints (x1,y1), (x2,y2) of a chord
- lift pen and goto first endpoint; drop it & goto second
- increment angle

The first recorded algorithm for rigorously calculating the value of π was a geometrical approach using polygons, devised around 250 BC by the Greek mathematician Archimedes.^{[1]} This polygonal algorithm dominated for over 1,000 years, and as a result π is sometimes referred to as "Archimedes' constant".^{[2]} Archimedes computed upper and lower bounds of π by drawing a regular hexagon inside and outside a circle, and successively doubling the number of sides until he reached a 96-sided regular polygon. By calculating the perimeters of these polygons, he proved that 223/71 < π < 22/7 (that is 3.1408 < π < 3.1429).^{[3]} Archimedes' upper bound of 22/7 may have led to a widespread popular belief that π is equal to 22/7.^{[4]} Around 150 AD, Greek-Roman scientist Ptolemy, in his *Almagest*, gave a value for π of 3.1416, which he may have obtained from Archimedes or from Apollonius of Perga.^{[5]} Mathematicians using polygonal algorithms reached 39 digits of π in 1630, a record only broken in 1699 when infinite series were used to reach 71 digits.^{[6]}

In ancient China, values for π included 3.1547 (around 1 AD), √10 (100 AD, approximately 3.1623), and 142/45 (3rd century, approximately 3.1556).^{[7]} Around 265 AD, the Wei Kingdom mathematician Liu Hui created a polygon-based iterative algorithm and used it with a 3,072-sided polygon to obtain a value of π of 3.1416.^{[8]}^{[9]} Liu later invented a faster method of calculating π and obtained a value of 3.14 with a 96-sided polygon, by taking advantage of the fact that the differences in area of successive polygons form a geometric series with a factor of 4.^{[8]} The Chinese mathematician Zu Chongzhi, around 480 AD, calculated that π ≈ 355/113 (a fraction that goes by the name *Milü* in Chinese), using Liu Hui's algorithm applied to a 12,288-sided polygon. With a correct value for its seven first decimal digits, this value of 3.141592920... remained the most accurate approximation of π available for the next 800 years.^{[10]}

The Indian astronomer Aryabhata used a value of 3.1416 in his *Āryabhaṭīya* (499 AD).^{[11]} Fibonacci in c. 1220 computed 3.1418 using a polygonal method, independent of Archimedes.^{[12]} Italian author Dante apparently employed the value 3+√2/10 ≈ 3.14142.^{[12]}

The Persian astronomer Jamshīd al-Kāshī produced 9 sexagesimal digits, roughly the equivalent of 16 decimal digits, in 1424 using a polygon with 3×2^{28} sides,^{[13]}^{[14]} which stood as the world record for about 180 years.^{[15]} French mathematician François Viète in 1579 achieved 9 digits with a polygon of 3×2^{17} sides.^{[15]} Flemish mathematician Adriaan van Roomen arrived at 15 decimal places in 1593.^{[15]} In 1596, Dutch mathematician Ludolph van Ceulen reached 20 digits, a record he later increased to 35 digits (as a result, π was called the "Ludolphian number" in Germany until the early 20th century).^{[16]} Dutch scientist Willebrord Snellius reached 34 digits in 1621,^{[17]} and Austrian astronomer Christoph Grienberger arrived at 38 digits in 1630 using 10^{40} sides,^{[18]} which remains the most accurate approximation manually achieved using polygonal algorithms.^{[17]}

**^**Arndt & Haenel 2006, p. 170**^**Arndt & Haenel 2006, pp. 175, 205**^**"The Computation of Pi by Archimedes: The Computation of Pi by Archimedes – File Exchange – MATLAB Central". Mathworks.com. Retrieved 2013-03-12.**^**Arndt & Haenel 2006, p. 171**^**Arndt & Haenel 2006, p. 176

Boyer & Merzbach 1991, p. 168**^**Arndt & Haenel 2006, pp. 15–16, 175, 184–186, 205. Grienberger achieved 39 digits in 1630; Sharp 71 digits in 1699.**^**Arndt & Haenel 2006, pp. 176–177- ^
^{a}^{b}Boyer & Merzbach 1991, p. 202 **^**Arndt & Haenel 2006, p. 177**^**Arndt & Haenel 2006, p. 178**^**Arndt & Haenel 2006, pp. 179- ^
^{a}^{b}Arndt & Haenel 2006, pp. 180 **^**Azarian, Mohammad K. (2010). "al-Risāla al-muhītīyya: A Summary".*Missouri Journal of Mathematical Sciences*.**22**(2): 64–85.**^**O'Connor, John J.; Robertson, Edmund F. (1999). "Ghiyath al-Din Jamshid Mas'ud al-Kashi".*MacTutor History of Mathematics archive*. Retrieved August 11, 2012.- ^
^{a}^{b}^{c}Arndt & Haenel 2006, p. 182 **^**Arndt & Haenel 2006, pp. 182–183- ^
^{a}^{b}Arndt & Haenel 2006, p. 183 **^**Grienbergerus, Christophorus (1630).*Elementa Trigonometrica*(PDF) (in Latin). Archived from the original (PDF) on 2014-02-01. His evaluation was 3.14159 26535 89793 23846 26433 83279 50288 4196 < π < 3.14159 26535 89793 23846 26433 83279 50288 4199.

%d bloggers like this: