How Al-Kāshī Calculated Pi with Polygons

How Al-Kāshī Calculated Pi with Polygons

Muslim Post Editorial Desk@muslimpost

Follow al-Kāshī’s polygon bounds from six sides to 805 million, then see how he wrote 2π in base sixty and decimal fractions in fifteenth-century Samarkand.

Jamshīd al-Kāshī calculated the circumference of a circle by squeezing it between two polygon perimeters. In his 1424 Treatise on the Circumference, he carried the calculation to a pair of polygons with 805,306,368 sides each. The number usually printed as 6.2831853071795865 is his decimal result for the circumference of a unit-radius circle, or 2π. To see what the digits mean, start with a six-sided polygon and follow how the bounds tighten as its sides double.

Why two polygons give bounds for a circle

Draw a regular hexagon with its vertices on a circle. Every straight side is shorter than the arc that joins its endpoints, so the hexagon’s perimeter is a lower bound for the circumference. Now put a regular hexagon around the same circle so that each side touches it at one point. The tangents meet outside the circle and the perimeter is an upper bound. The circumference sits between the two perimeters.

Double the number of sides by halving each central angle. The new chords follow the circle more closely, and the outer tangent segments meet closer to it. For a unit circle, the inner hexagon has six sides of length 1. The outer one has six sides of length 2 divided by the square root of 3. That gives the first pair of bounds in the table. Each later row repeats the same geometric construction at a finer spacing.

These perimeters are computed in modern decimal notation and rounded for display. The radius stays at 1 throughout. The gap between the two numbers measures how much room remains for the true circumference.

SidesInscribed perimeterCircumscribed perimeter
66.0000006.928203
126.2116576.430781
246.2652576.319320
486.2787006.292172

With 6 sides the gap is about 0.9282 units. With 48 sides it has fallen to about 0.0135. Doubling again continues this process without measuring a physical circle. Archimedes also used inner and outer polygons. The part that makes al-Kāshī’s calculation distinctive is how far he takes the doubling and how carefully he handles the numerical accuracy of each step.

How al-Kāshī made the doubling calculable

Al-Kāshī worked with a radius of 60, a familiar scale in the trigonometry of his time. Jan P. Hogendijk’s reading of the treatise expresses the calculation using a length we can call k: twice the perpendicular distance from the centre to one side of the inscribed polygon. For the hexagon, that length is 60√3. It comes from a right triangle with hypotenuse 60 and a short side of 30, half the length of the hexagon’s side.

When the number of sides doubles, the half-angle geometry gives a new value of k equal to √[60 × (120 + k)], where the k inside the brackets is the previous value. To go from six sides to twelve, the previous length is about 103.923048 and the new one about 115.911099. The same step can be applied repeatedly. To get the side of the inscribed polygon, use the right triangle again with the new centre-to-side distance. To get the side of the circumscribed polygon, scale the inner side by the ratio of the radius to that distance. Multiplying the side lengths by the number of sides gives the two perimeters.

Hogendijk explains that the calculation of the square roots kept 18 sexagesimal fractional places. This working precision mattered because two large, nearly equal lengths entered into the determination of a very short chord. After 27 doublings of the hexagon, the number of sides is 6 × 227, the same as 3 × 228. Once the two perimeters were computed, they had to be scaled from the radius of 60 to a radius of 1 before their values could be compared with 2π.

Why go that far? In the introduction translated by Mohammad K. Azarian, al-Kāshī sets an error target below the width of a horsehair for a hypothetical circle whose diameter is 600,000 times Earth’s. This is a statement about how small the computational error should be on a chosen scale. The perimeter of a drawn circle or the width of a particular hair was not the input to the calculation.

What the sexagesimal and decimal digits mean

Hogendijk transcribes two close bounds and reports that al-Kāshī took their arithmetic mean. The result in modern sexagesimal notation is 6;16,59,28,1,34,51,46,14,50. There are nine base-sixty fractional positions. The first two contribute 16/60 and 59/602 to the integer 6. Each position further to the right contributes a fraction with one more factor of 60 in the denominator. The lunar model of Ibn al-Shāṭir offers a shorter example of the same positional convention for lengths.

The sexagesimal value evaluates to approximately 6.2831853071795864848 in decimal. Rounded to sixteen decimal places it is 6.2831853071795865, the value Hogendijk reports from the treatise. The modern value of 2π begins 6.2831853071795864769 and rounds to the same sixteen-place result. The match is a statement about rounding. The two unrounded values differ at the sixteenth decimal position, but both lie on the same side of the threshold for rounding to 6.2831853071795865. Because the unit circle has diameter 2, dividing its circumference by 2 gives π.

A modern recalculation of the final pair of unit-radius polygons gives a lower perimeter of about 6.283185307179586461 and an upper one of about 6.283185307179586509. Those values round to the same sixteen-place value of 2π. This calculation also shows why a short table of decimal perimeters can teach the idea, while the extra places used in the historical working were needed to carry it out.

The two bounds are also instructive in base sixty. Hogendijk transcribes a lower bound ending in 49,45 and an upper one ending in 50,15 after the shared prefix through 14. At that scale the lower bound is fifteen units of the last place below 50,00 and the upper bound is fifteen above it. This makes their midpoint easy to check. The average supplies a single number for the table, while the difference between the bounds supplies evidence about its accuracy. Those are two separate results of the calculation.

What the Mashhad copy actually shows

The Arabic Treatise on the Circumference survives in several manuscript copies. The Islamic Scientific Manuscripts Initiative lists the copy in Mashhad as MS 5389. Page 46 of the facsimile reproduced by Hogendijk shows a grid of columns and rows. He identifies it as the decimal table of multiples of 2π. The handwritten digits are arranged by place value. Reading the heading of a column matters as much as recognizing the digit in its cell, because the table does not mark the fraction with a modern decimal point.

The manuscript’s status also matters. Azarian follows the attribution of MS 5389 to al-Kāshī’s own hand, citing the colophon and a later owner’s note. Hogendijk argued in his study that a copyist could reproduce a colophon and identified errors that led him to doubt the autograph attribution. The facsimile allows a reader to see how the work was set out, while the attribution of the handwriting depends on the evidence considered by the editors.

How the Key to Arithmetic used decimal fractions

Al-Kāshī’s Key to Arithmetic, completed in 1427, is a different work. The British Library’s Arabic copy IO Islamic 1039 has five main treatises covering integers, fractions, astronomical calculation, measurement and algebra. Its catalogue locates the fraction treatise at folios 31r–41v. The manuscript introduction also contains a dedication to Ulugh Beg. These are features of the work as preserved in a later copy, so the copy date and the date of the original composition answer different questions.

Nuh Aydin and Lakhdar Hammoudi describe al-Kāshī’s contribution as a systematic treatment of decimal fractions and point to much earlier work by al-Uqlīdisī. The underlying use of place value also has a history that can be traced through Hindu-Arabic numerals. In the circumference calculation, decimal places give a compact way to report an answer. In the arithmetic book, fractions and their operations are part of a course of calculation alongside whole numbers and the base-sixty methods used by astronomers.

What a letter tells us about calculation in Samarkand

In a letter to his father translated by Mohammad Bagheri, al-Kāshī describes Ulugh Beg testing him on the Sun’s zodiacal position for an earlier event. Al-Kāshī says he reached 23 degrees of Virgo mentally and had difficulty recovering the minutes precisely. The passage gives a concrete example of the difference between identifying a degree and carrying the calculation into its fractional places. It is al-Kāshī’s account of the exchange.

Astronomers had written zīj tables for these kinds of calculations. Earlier work by al-Battānī illustrates the relationship between observations, trigonometry and numerical tables. In the circle problem, the chosen error bound tells the calculator when the two perimeters are close enough. In the letter, the difficulty of the minutes shows the practical value of knowing exactly which places have been found reliably.

The cover is an original AI-assisted reconstruction of a scholarly setting. It illustrates the subject and does not reproduce a portrait or manuscript page.

Sources