Liu Hui was the first Chinese mathematician to provide a rigorous algorithm for calculation of π to any accuracy.
Liu Hui remarked in his commentary to The Nine Chapters on the Mathematical Art,[2] that the ratio of the circumference of an inscribed hexagon to the diameter of the circle was three, hence π must be greater than three.
Later he invented a quick method to improve on it, and obtained π ≈ 3.1416 with only a 96-gon, a level of accuracy comparable to that from a 1536-gon.
Multiplying d by one side results in oblong ABCD which exceeds the boundary of the circle.
In general, multiplying half of the circumference of a N-gon by its radius yields the area of a 2N-gon.
Liu Hui proved an inequality involving π by considering the area of inscribed polygons with N and 2N sides.
Liu Hui used the Pythagorean theorem repetitively: From here, there is now a technique to determine m from M, which gives the side length for a polygon with twice the number of edges.
Starting with a hexagon, Liu Hui could determine the side length of a dodecagon using this formula.
Knowing how to determine the area of these polygons, Liu Hui could then approximate π.
; he pointed out this number is slightly less than the actual value of π. Liu Hui carried out his calculation with rod calculus, and expressed his results with fractions.
However, the iterative nature of Liu Hui's π algorithm is quite clear: in which m is the length of one side of the next–order polygon bisected from M. The same calculation is done repeatedly, each step requiring only one addition and one square root extraction.
Calculation of square roots of irrational numbers was not an easy task in the third century with counting rods.
This explains four questions: Liu Hui established a solid algorithm for calculation of π to any accuracy.
Truncated to eight significant digits: That was the famous Zu Chongzhi π inequality.
Zu Chongzhi then used the interpolation formula by He Chengtian (何承天, 370-447) and obtained an approximating fraction:
However, this π value disappeared in Chinese history for a long period of time (e.g. Song dynasty mathematician Qin Jiushao used π=
), until Yuan dynasty mathematician Zhao Yuqin worked on a variation of Liu Hui's π algorithm, by bisecting an inscribed square and obtained again
[5] Liu Hui's π algorithm was one of his most important contributions to ancient Chinese mathematics.