-
Notifications
You must be signed in to change notification settings - Fork 0
/
bisection-sim.html
82 lines (78 loc) · 3.96 KB
/
bisection-sim.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bisection Method</title>
<link rel="icon" type="image/x-icon" href="images/FavAndLogo.jpg">
<link rel="stylesheet" href="css/style-bisection-sim.css">
<script src='https://cdn.plot.ly/plotly-2.4.2.min.js'></script>
</head>
<body oncontextmenu="return false">
<header>
<div class="logo"><img class="logo" src="images/andc_logo.jpg"></div>
<h1>VLab@ANDC</h1>
<ul class="navigation">
<li><a href="index.html">Home</a></li>
<li><a href="index.html#labs_section">Labs</a></li>
<li><a href="index.html#team">Team</a></li>
<li><a href="index.html#contact">Contact Us</a></li>
<li><a href="https://www.andcollege.du.ac.in/" target="_blank" rel="noopener noreferrer">College Website</a>
</li>
</ul>
</header>
<div class="heading">
<div class="heading--1"><h1>Bisection-Method</h1></div>
<div class="heading--2"><h1>For finding the roots of linear, quadratic and third degree polynomial</h1></div>
</div>
<div class="explanation">
Given a function f(x) on floating number x and two numbers 'a' and 'b' such that f(a)*f(b) < 0 and f(x) is
continuous in [a, b]. Here f(x) represents algebraic or transcendental equation. Find root of function in
interval [a, b] (Or find a value of x such that f(x) is 0).<br> <b>Input:</b> <br> A function of x,
<u><b>for example</b></u> x<sup>3</sup> +4x<sup>2</sup> + 8. And two values: a=(-5) and b= (1) such that
f(a)*f(b) < 0, i.e., f(a) and f(b) have opposite signs.<br><b>Output:</b><br> The value of root is : -4.412 or any other value with allowed deviation from root. </div>
<form class="bisection-method">
<p class="equation-detail">f(x)= a x<sup>3</sup> +b x<sup>2</sup>+c x<sup>1</sup> + d :</p>
<p class="equation-detail">Enter the coefficients of the equation:</p>
<input type="text" placeholder="a" class="cube--equation cube-coefficient">x<sup>3</sup>+
<input type="text" placeholder="b" class="cube--equation square-coefficient">x<sup>2</sup>+
<input type="text" placeholder="c" class="cube--equation linear-coefficient">x<sup>1</sup>+
<input type="text" placeholder="d" class="cube--equation coefficient"><br>
<label for="iterations">Enter the number of iterations: </label>
<input type="text" placeholder="i" class="cube--equation iterations"><br>
<label for="intervals">Enter the intervals [g,h]: </label>g =
<input type="text" placeholder="g" class="cube--equation interval--A">, h =
<input type="text" placeholder="h" class="cube--equation interval--B"> <br>
<label for="rootGenerate">For generating root: </label>
<button class="btn--cls root--finder">Click here</button>
<div class="result">
<span class="validRange">Result: </span><span class="eqnResult"></span>
</div>
<button id="file--download" class="btn--cls">File Download</button><br>
<label for="gtext">Graph:</label>
<div id="graph">
</div>
</form>
<script src="js/bisection-sim.js"></script>
<script>
document.onkeydown = function(e) {
if(event.keyCode == 123) {
return false;
}
if(e.ctrlKey && e.shiftKey && e.keyCode == 'I'.charCodeAt(0)) {
return false;
}
if(e.ctrlKey && e.shiftKey && e.keyCode == 'C'.charCodeAt(0)) {
return false;
}
if(e.ctrlKey && e.shiftKey && e.keyCode == 'J'.charCodeAt(0)) {
return false;
}
if(e.ctrlKey && e.keyCode == 'U'.charCodeAt(0)) {
return false;
}
}
</script>
</body>
</html>