-
Notifications
You must be signed in to change notification settings - Fork 0
/
calculator3.html
45 lines (43 loc) · 1.35 KB
/
calculator3.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Калькулятор</title>
</head>
<body>
<h2>Введите число:</h2>
<input type="text" id="number" name="number">
<button onclick="calculate()">Рассчитать</button>
<br><br>
<table>
<tr>
<td>Пропорциональность:</td>
<td><span id="result1"></span></td>
</tr>
<tr>
<td>m_yaw:</td>
<td><span id="result2"></span></td>
</tr>
<tr>
<td>sensitivity:</td>
<td><input type="text" id="sensitivity" name="sensitivity"></td>
</tr>
<tr>
<td>Результат:</td>
<td><span id="result3"></span></td>
</tr>
</table>
<script>
function calculate() {
var number = parseFloat(document.getElementById("number").value);
var prop = number / 0.022;
var m_yaw = 0.022 / prop;
var sensitivity = parseFloat(document.getElementById("sensitivity").value);
var result = sensitivity * prop;
document.getElementById("result1").innerHTML = prop.toFixed(10);
document.getElementById("result2").innerHTML = m_yaw.toFixed(10);
document.getElementById("result3").innerHTML = result.toFixed(10);
}
</script>
</body>
</html>