This Is Not a Circle: The Extraordinary Algorithm of Liu Hui

Joshua Fitzgerald
5 min readOct 8, 2018

This is not a circle.

It is a polygon. Look closely. It has 192 sides and 192 corners. Can you tell?

Lacking overpriced calculators with plastic pi buttons to do the heavy lifting, ancient mathematicians relied on polygons like this one to compute accurate values for pi.

This is precisely what the ancient Chinese mathematicians Liu Hui, and later Zu Chongzhi, were able to do in the third and fifth centuries. They computed the perimeters of polygons with a huge number of sides, getting an excellent approximation for pi in the process.

They had no powerful computing tools. No calculators, not even an abacus. They made due with rod calculus, a calculation system based on small piles of sticks — but they did have a crucial insight: it is not necessary to create a method that computes an accurate approximation for pi on the first go. All you need is a method that can take some approximation and improve it. You can repeat this process as many times as you like until the result is as accurate as you desire.

Lui Hui’s method — based on the Pythagorean Theorem — allowed pi to be approximated to five decimal places by hand.

Lui Hui noticed that if you know the perimeter of any regular polygon, it is relatively easy to…

--

--

Joshua Fitzgerald

Joshua is a mathematician, educator, cryptographer, and developer. He is a developer at Heliax working on the @anoma protocol.