Skip to content

Commit 18b23b0

Browse files
committed
docs: add pi.rst
1 parent 8bd617c commit 18b23b0

4 files changed

Lines changed: 80 additions & 1 deletion

File tree

source/algo/main.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
アルゴリズム
2+
===============
3+
4+
.. toctree::
5+
:maxdepth: 2
6+
:caption: Contents:
7+
8+
math/main

source/algo/math/main.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
数学
2+
===============
3+
4+
.. toctree::
5+
:maxdepth: 2
6+
:caption: Contents:
7+
8+
pi

source/algo/math/pi.rst

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
:math:`\pi` の計算
2+
=====================
3+
4+
円周率 :math:`\pi` は,
5+
6+
.. math::
7+
8+
\pi = \frac{C}{d}
9+
10+
として定義される.ここで :math:`C` は円周の長さ,:math:`d` は円の直径である.その具体的な値は,
11+
12+
.. math::
13+
14+
\pi = 3.1415926535\; 8979323846\; 2643383279\; 5028841971\; 6939937510\;\ldots
15+
16+
と無限に続く数として知られている.
17+
18+
多角形近似
19+
-------------
20+
21+
半径1の円に内接する正 :math:`n` 角形の周りの長さを :math:`2\pi_n` とすると,
22+
23+
.. math::
24+
25+
\pi_n = n \sin\frac{\pi}{n}
26+
27+
となり,
28+
29+
.. math::
30+
31+
\frac{\pi_n}{n} = \sin\frac{\pi}{n}
32+
= 2\sin\frac{\pi}{2n}\cos\frac{\pi}{2n}
33+
= 2\frac{\pi_{2n}}{2n}\cos\frac{\pi}{2n}.
34+
35+
これを再帰的に適用すると,
36+
37+
.. math::
38+
39+
\pi_n = \lim_{k\rightarrow \infty} 2^kn\sin\frac{\pi}{2^kn}\prod_{j=1}^k\cos\frac{\pi}{2^jn}
40+
41+
\frac{1}{\pi} = \lim_{k\rightarrow \infty}\frac{1}{\pi_n}\left(\frac{2^kn}{\pi}\sin\frac{\pi}{2^kn}\right)\prod_{j=1}^k\cos\frac{\pi}{2^jn}
42+
43+
となり,
44+
45+
.. math::
46+
47+
\pi = \frac{n\sin\frac{\pi}{n}}{\prod_{j=1}^\infty\cos\frac{\pi}{2^jn}}
48+
49+
を得る.また,
50+
51+
.. math::
52+
53+
\cos\frac{\pi}{2k} = \sqrt{\frac{1}{2}+\frac{1}{2}\cos\frac{\pi}{k}}
54+
55+
を用いて,ビエトの公式
56+
57+
.. math::
58+
59+
\frac{2}{\pi} = \prod_{j=0}^\infty\cos\frac{\pi}{4\cdot 2^j}
60+
= \sqrt{\frac{1}{2}}\sqrt{\frac{1}{2}+\frac{1}{2}\sqrt{\frac{1}{2}}}\sqrt{\frac{1}{2}+\frac{1}{2}\sqrt{\frac{1}{2}+\frac{1}{2}\sqrt{\frac{1}{2}}}}\cdots
61+
62+
を得る.なお, :math:`n=4` とした.

source/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ Iris
88

99
sm/main
1010
ckt/main
11-
toc/main
1211
ml/main
12+
algo/main
13+
toc/main
1314
robotics/main
1415
os/main
1516
ref

0 commit comments

Comments
 (0)