-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
56 lines (56 loc) · 2.79 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!DOCTYPE html>
<html lang="en-US">
<head><title>default</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>Calculating π using various fast-converging series</h1>
<div>
Number of digits:
<input type="text" id="digits"></input>
Algorithm:
<select name="algorithms" id="algorithms">
<option value="Leibniz">Leibniz formula</option>
<option value="Nilakantha">Nilakantha's formula 1</option>
<option value="Nilakantha2">Nilakantha's formula 2</option>
<option value="Nilakantha3">Nilakantha's formula 3</option>
<option value="AtanKikuo">Kikuo Takano's arctangent sum</option>
<option value="AtanStormer">F. C. M. Störmer's arctangent sum</option>
<option value="AtanHwang" selected="selected">Hwang Chien-Lih's arctangent sum</option>
</select>
<input type="button" id="go" value="Go!"></input>
</div>
<pre id="display"></pre>
<div>
<h2>List of used algorithms</h2>
<h3>Machin-like formula</h3>
<a target="_blank" href="https://en.wikipedia.org/wiki/Machin-like_formula">Machin-like formula</a>
<ul>
<li>Hwang Chien-Lih's arctangent sum
<li>F. C. M. Störmer's arctangent sum
<li>Kikuo Takano's arctangent sum
</ul>
<h3>Leibniz based formulas</h3>
<a target="_blank" href="https://www.researchgate.net/publication/283579663_Nilakantha's_accelerated_series_for_pi">Nilakantha's accelerated series for pi</a>
<ul>
<li>Leibniz formula
<li>Nilakantha's formula 1
<li>Nilakantha's formula 2
<li>Nilakantha's formula 3
</ul>
<h4>Disclaimer: last few digits are wrong, so if you're going to use this program somewhere, make sure to throw away the last 10 or so digits</h4>
<h2>Brief description</h2>
<p>
This is my last day of calculating pi, so I put some effort on implementing multiple fast-converging series.<br>
I implemented <a target="_blank" href="https://github.com/martian17/bigfrac.js">a small extension</a> to the existing BigInt JavaScript feature to accomodate fraction arithmetics.<br>
And for the arc-tangents I simply decomposed them into taylor-series and re-factored them as a sum<br>
</p>
</div>
<a target="_blank" href="https://codepen.io/MartianLord/full/jOyKmGz">Demo</a><br>
<a target="_blank" href="https://github.com/martian17/big-pi">Github</a><br>
<a target="_blank" id="github" href="https://github.com/martian17/big-pi">Fork me on Github</a>
<script src="BigFrac.js"></script>
<script src="main.js"></script>
</body>