本文へスキップ

リソース · ガイド・記事

Liu Hui's π Algorithm

劉徽が円に内接する多角形の辺の数を繰り返し倍にして円周率の範囲を絞り込んだ方法を紹介する、数学史の背景資料です。面接の中心的なテーマを学ぶ人よりも、数値近似のパズルを楽しむ候補者に向いています。

確認日

元のサイトを開く: Liu Hui's π Algorithm (元のサイトを新しいタブで開きます)

ロードマップに追加

取り組んでいるロードマップにこのリソースを追加できます。自分用の追加リソースとして表示され、ロードマップの手順は変わらず、記録した手順数にも数えられません。

出典コンテンツの言語:英語

Liu Hui remarked in his commentary to The Nine Chapters on the Mathematical Art, that the ratio of the circumference of an inscribed hexagon to the diameter of the circle was three, hence π must be greater than three. He went on to provide a detailed step-by-step description of an iterative algorithm to calculate π to any required accuracy based on bisecting polygons; he calculated π to between 3.141024 and 3.142708 with a 96-gon; he suggested that 3.14 was a good enough approximation, and expressed π as 157/50; he admitted that this number was a bit small. Later he invented an ingenious quick method to improve on it, and obtained π ≈ 3.1416 with only a 96-gon, with an accuracy comparable to that from a 1536-gon. His most important contribution in this area was his simple iterative π algorithm. Liu Hui's method of calculating the area of a circle. Further, Liu Hui proved that the area of a circle is half of its circumference multiplied by its radius. He said:

PrepKit の概要

この概要は PrepKit 編集部がソースリポジトリをもとに執筆・確認したもので、リソース本文の引用ではありません。

対象
ソースにレベルの記載はありません
形式
レッスン

扱っている内容

  • 冒頭で劉徽の成果を紹介しています:96角形による上下限、157/50 という近似値、そしてより速い改良法。
  • 円の面積の節:多角形の面積が円の面積に近づく理由を示し、A = r x C/2 で締めくくっています。
  • 反復アルゴリズムの節:六角形の辺を二等分し、ピタゴラスの定理(勾股)を使って6角形の辺から12角形の辺を求めます。

使い方

PrepKit の学習アドバイスであり、ソースの主張ではありません。

辺を倍にする手順を、六角形から24角形まで紙の上でたどってください。次に、それを繰り返して各回の円周率の推定値を表示する短いループを書きます。倍にするたびに推定が締まる理由を説明できれば完了です。

範囲と制約

大半は歴史と幾何で、面接に直接関係する部分はわずかです。重要な公式は Wikimedia の画像としてしか載っておらず、参考文献は Wikipedia の1件だけです。演習や計算量の説明はありません。

利用方法と形式

GitHub の MIT ライセンスの trekhleb/javascript-algorithms リポジトリにある、英語の Markdown による README で、無料で読めます。

PrepKit が 2026/10/02 に確認しました。 リソースの出典のコミット: 85293e3e2b88

この概要の根拠
  • src/algorithms/math/liu-hui/README.md

この項目を掲載しているページ

PrepKit ニュースレターを受け取る

任意です。PrepKit の利用には必要ありません。

メールアドレスの取り扱いについて