-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAN_Labo6_RiebenAxel.html
More file actions
116 lines (109 loc) · 4.28 KB
/
AN_Labo6_RiebenAxel.html
File metadata and controls
116 lines (109 loc) · 4.28 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
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="author" content="Axel Rieben">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AN Labo6 Rieben Axel</title>
<link rel="stylesheet" href="style.css">
<script type="text/javascript" src="AN_Labo6_RiebenAxel.js"></script>
</head>
<body>
<header>
<h1>AN Labo6 Rieben Axel</h1>
<h3 class="subheading">CORDIC Algorithm</h3>
</header>
<section>
<!-- Inputs -->
<p>
Choose an angle for the approximation (in degrees) : <span><input id="alpha" type="number" min="0" max="90" step="0.01" value="30"> <output id="errorAlpha"></output></span>
</p>
<p>
Choose a number of iteration : <span><input id="iteration" type="number" min="1" max="1000" step="1" value="40"> <output id="errorIteration"></output></span>
</p>
<p>
<button onclick="run()">Run</button>
</p>
<!-- Results -->
<table>
<tr>
<th></th>
<th>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>cos</mi>
<mo>(</mo>
<mi>x</mi>
<mo>)</mo>
</math>
</th>
<th>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>sin</mi>
<mo>(</mo>
<mi>x</mi>
<mo>)</mo>
</math>
</th>
<th>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>tan</mi>
<mo>(</mo>
<mi>x</mi>
<mo>)</mo>
<mo>=</mo>
<mfrac>
<mrow>
<mi>sin</mi>
<mo>(</mo>
<mi>x</mi>
<mo>)</mo>
</mrow>
<mn>
<mi>cos</mi>
<mo>(</mo>
<mi>x</mi>
<mo>)</mo>
</mn>
</mfrac>
</math>
</th>
</tr>
<tr>
<th>CORDIC approximation</th>
<td class="table-output"><output id="cordicCos"></output></td>
<td class="table-output"><output id="cordicSin"></output></td>
<td class="table-output"><output id="cordicTan"></output></td>
</tr>
<tr>
<th>Javascript Math value</th>
<td class="table-output"><output id="jsCos"></output></td>
<td class="table-output"><output id="jsSin"></output></td>
<td class="table-output"><output id="jsTan"></output></td>
</tr>
<tr>
<th>Difference</th>
<td class="table-output"><output id="diffCos"></output></td>
<td class="table-output"><output id="diffSin"></output></td>
<td class="table-output"><output id="diffTan"></output></td>
</tr>
</table>
<p>
<output id="cordicTime"></output>
</p>
</section>
<footer>
<span class="explanation">Explanations</span><span> (The footer is also scrollable)</span>
<p>CORDIC (COordinate Rotation DIgital Computer) is a simple and efficient algorithm to calculate trigonometric functions.</p>
<p>How to use the website ?</p>
<ol>
<li>Choose an angle for which the trigonometric results want to be known (it must be beetween 0 and 90 degrees);</li>
<li>Choose a number of iteration for the algorithm (it must be beetween 1 and 1000 cycles);</li>
<li>Press the "Run" button;</li>
<li>The results are shown in the table</li>
</ol>
<p class="footer">
Axel Rieben - AN_Labo6_RiebenAxel.html - Numerical Algorithm, HE-Arc 2017
</p>
</footer>
</body>
</html>