Zhao Youqin's π algorithm is an algorithm devised by Yuan dynasty Chinese astronomer and mathematician Zhao Youqin (赵友钦, ? – 1330) to calculate the value of π in his book Ge Xiang Xin Shu (革象新书).
Algorithm Zhao Youqin started with an inscribed square in a circle with radius r. If ℓ {\displaystyle \ell } denotes the length of a side of the square, draw a perpendicular line d from the center of the circle to side l. Let e denotes r − d. Then from the diagram:
d = r 2 − ( ℓ 2 ) 2 {\displaystyle d={\sqrt {r^{2}-\left({\frac {\ell }{2}}\right)^{2}}}}
e = r − d = r − r 2 − ( ℓ 2 ) 2 . {\displaystyle e=r-d=r-{\sqrt {r^{2}-\left({\frac {\ell }{2}}\right)^{2}}}.}
Extend the perpendicular line d to dissect the circle into an octagon; ℓ 2 {\displaystyle \ell _{2}} denotes the length of one side of octagon.
ℓ 2 = ( ℓ 2 ) 2 + e 2 {\displaystyle \ell _{2}={\sqrt {\left({\frac {\ell }{2}}\right)^{2}+e^{2}}}}
ℓ 2 = 1 2 ℓ 2 + 4 ( r − 1 2 4 r 2 − ℓ 2 ) 2 {\displaystyle \ell _{2}={\frac {1}{2}}{\sqrt {\ell ^{2}+4\left(r-{\frac {1}{2}}{\sqrt {4r^{2}-\ell ^{2}}}\right)^{2}}}}
Let l 3 {\displaystyle l_{3}} denotes the length of a side of hexadecagon
ℓ 3 = 1 2 ℓ 2 2 + 4 ( r − 1 2 4 r 2 − ℓ 2 2 ) 2 {\displaystyle \ell _{3}={\frac {1}{2}}{\sqrt {\ell _{2}^{2}+4\left(r-{\frac {1}{2}}{\sqrt {4r^{2}-\ell _{2}^{2}}}\right)^{2}}}}
similarly
… excerpt ends here. Continue reading the full article.


