This repository was archived by the owner on Jul 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroot.html
More file actions
executable file
·55 lines (49 loc) · 2.04 KB
/
Copy pathroot.html
File metadata and controls
executable file
·55 lines (49 loc) · 2.04 KB
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
<!DOCTYPE html>
<html>
<head>
<title>Root-finding</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/numercial.css">
<script type="text/javascript" src="js/numercial.js"></script>
</head>
<body>
<fieldset id="eqfieldset">
<legend>Equation Parameters</legend>
<center>
<p><input type="text" placeholder="Equation goes here" id="in_eq"></p>
<p><input type="text" placeholder="from" id="eq_start" size="2">
<input type="text" placeholder="to" id="eq_end" size="2"></p>
<p><label>Precision</label><input type="range" min="2" max="10" value="4" id="slide_precision" onchange="calcRoot()"></p>
<p><label>Tolerance</label><input type="range" min="1" max="12" value="2" id="slide_tol" onchange="calcRoot()"></p>
<div id="methodRadio"><input type="radio" name="method" value="bisect" checked onclick="calcRoot()"> Bisect Method<br>
<input type="radio" name="method" value="secant" onclick="calcRoot()"> Secant Method<br>
<input type="radio" name="method" value="mod_secant" onclick="calcRoot()"> Mod-Secant Method</div>
<button onclick="calcRoot()">Find root</button>
<p><label id="out_ans"></label></p>
</center>
</fieldset>
<fieldset id="exfieldset">
<legend>Examples</legend>
<center>
<ul style="margin-right:20px;">
<li>x^2 - 2 * x - 3, [2, 5]</li>
<li>sin(x) - x^3, [0.5, 1]</li>
<li>x^3 + 4 * x^2 - 10, [1, 2]</li>
</ul>
</center>
</fieldset>
<table class="tg" id="itable" width="65%">
<tr>
<th style="background-color: lightblue;">i</th>
<th>a</th>
<th>b</th>
<th>c</th>
<th>f (a)</th>
<th>f (b)</th>
<th>f (c)</th>
<th>| f (c) | < ε</th>
<th>| c<sub>i</sub> - c<sub>i - 1</sub> | < ε</th>
</tr>
</table>
</body>
</html>