-
Notifications
You must be signed in to change notification settings - Fork 0
/
dangerleccy.html
336 lines (320 loc) · 18.4 KB
/
dangerleccy.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
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
<html><head> <meta charset="UTF-16"> </head><body>
This calculator will work out the most dangerous possible input current/potential difference for a given amount of power. This is useful for answering the question of the most dangerous current and potential difference combination for a given situation. Potential difference is not what causes danger; it is current. However, in order to get through the very high resistance of a body of a creature, a high enough potential difference is needed. This is what makes these questions so interesting, however answers are generally extremely poor. This badly designed calculator has the aim of solving this.
<br/><br/>
For any of the values, do not enter 0 or anything that is not a number as I might just hit you with one of these dangerous combinations if you do as much. I also apologise that the units are imperial; I have yet to produce decimal alternatives.
<br/><br/>
Resistance is measured in ohms. As a reference, the human body can have a resistance of anywhere from 100Ω on the tongue up to 100000Ω on dry skin.
<br/><br/>
Power is measured in watts (joules per imperial second).
<br/><br/>
The significant figures are the amount of significant figures that the input potential difference and current and the output current, power and potential difference will be displayed to. Going above 20 may cause issues.
<br/><br/>
The calculator will also attempt to work out whether alternating current or direct current would be more dangerous to a human, or whether both are likely to be fatal. Note that this should not be used expecting it to show any degree of real accuracy. In the case of a simple request of a fatal shock, the final calculator will work out the potential difference needed. In general, 0.15A is fatal.
<br/><br/>
In most cases, the power will be identical input and output because there is just enough potential difference to push the current through. If the output is higher than the input then you can hit me with the power you put into it, unless you put in a negative number or something. It could be just due to javascript's very poor square root function with large numbers however.
<br/><br/>
<font size="4" color="red"><b>THIS WEBPAGE AND ALL ITS CONTENTS ARE FOR EDUCATIONAL AND ENTERTAINMENT PURPOSES ONLY. ANY ELECTRICAL SAFETY CONCERNS SHOULD ALWAYS BE ADVISED BY A PROFESSIONAL. THE OWNER OF THIS WEBPAGE, THE HOSTS OF IT AND ANY CONTRIBUTORS MAY TAKE ABSOLUTELY <u>NO</u> RESPONSIBILITY FOR ANY HARM CAUSED TO YOURSELF OR OTHERS RESULTING FROM ABUSE OF THIS WEBPAGE.</b></font>
<br/><br/><br/>
Resistance (Ohms): <input type="number" id="resin" value="289" onclick="check()" onchange="check()">
Power (Watts): <input type="number" id="powin" value="4913" onclick="check()" onchange="check()">
Significant figures: <input type="number" id="sigin" value="5" onclick="check()" onchange="check()"> <button onclick="calcdanger()">CALCULATE MOST DANGEROUS CURRENT AND POTENTIAL DIFFERENCE LEVELS</button>
<span id="current"></span><span id="pot"></span><span id="output"></span><span id="output2"></span><span id="output3"></span><span id="count"></span><span id="acdc"></span>
<br/><br/><br/>
Using just current and resistance:
<br/><br/>
This uses an input of current as opposed to power and assumes the minimal amount if potential difference is used.
<br/><br/><br/>
Resistance (Ohms): <input type="number" id="resin1.7" value="289" onclick="check()" onchange="check()">
Current (Amperes): <input type="number" id="curin1.7" value="17" onclick="check()" onchange="check()">
Significant figures: <input type="number" id="sigin1.7" value="5" onclick="check()" onchange="check()"> <button onclick="calcdanger2()">CALCULATE MOST DANGEROUS CURRENT AND POTENTIAL DIFFERENCE LEVELS</button>
<span id="current1.7"></span><span id="pot1.7"></span><span id="output1.7"></span><span id="output21.7"></span><span id="output31.7"></span>
<br/><br/><br/>
Using just potential difference and resistance:
<br/><br/>
This uses an input of potential as opposed to power and assumes there is the maximum current available or more that can be pushed through and will work out the most dangerous current/potential difference.
<br/><br/><br/>
Resistance (Ohms): <input type="number" id="resin117" value="289" onclick="check()" onchange="check()">
Potential differnce (Volts): <input type="number" id="potin117" value="17" onclick="check()" onchange="check()">
Significant figures: <input type="number" id="sigin117" value="5" onclick="check()" onchange="check()"> <button onclick="calcdanger3()">CALCULATE MOST DANGEROUS CURRENT AND POTENTIAL DIFFERENCE LEVELS</button>
<span id="current117"></span><span id="pot117"></span><span id="output117"></span><span id="output2117"></span><span id="output3117"></span>
<br/><br/><br/>
Maximum resistance for specific current/potential difference:
<br/><br/>
This equally badly designed calculator will work out the maximum resistance for a specific current/potential difference.
<br/><br/><br/>
Current (Amperes): <input type="number" id="curin17" value="289" onclick="check()" onchange="check()">
Potential difference (Volts): <input type="number" id="potin17" value="4913" onclick="check()" onchange="check()">
Significant figures: <input type="number" id="sigin17" value="5" onclick="check()" onchange="check()"> <button onclick="calcmaxres()">CALCULATE MAXIMUM RESISTANCE FOR THE CURRENT AND POTENTIAL DIFFERENCE LEVELS</button>
<span id="resout17"></span>
<br/><br/><br/>
Current/potential difference after passing through a resistance:
<br/><br/>
This fifth badly designed calculator will work out the output current, potential difference and power after passing through a specific resistance.
<br/><br/><br/>
Current (Amperes): <input type="number" id="curin289" value="289" onclick="check()" onchange="check()">
Potential difference (Volts): <input type="number" id="potin289" value="4913" onclick="check()" onchange="check()">
Resistance (Ohms): <input type="number" id="resin289" value="17" onclick="check()" onchange="check()">
Significant figures: <input type="number" id="sigin289" value="5" onclick="check()" onchange="check()"> <button onclick="calcaftres()">CALCULATE OUTPUT CURRENT AND POTENTIAL DIFFERENCE</button>
<span id="curout289"></span><span id="potout289"></span><span id="powout289"></span>
<br/><br/><br/>
Current/potential difference after passing through a resistance:
<br/><br/>
This sixth calculator will work out the resistance something went through by the input power, output power and resistance.
<br/><br/><br/>
Power in (Watts): <input type="number" id="powin4913" value="289" onclick="check()" onchange="check()">
Power out (Watts): <input type="number" id="powout4913" value="289" onclick="check()" onchange="check()">
Potential difference (Volts): <input type="number" id="potin4913" value="4913" onclick="check()" onchange="check()">
Significant figures: <input type="number" id="sigin4913" value="5" onclick="check()" onchange="check()"> <button onclick="calcthrores()">CALCULATE RESISTANCE THE POWER WENT THROUGH</button>
<span id="resout4913"></span>
<br/><br/><br/>
Current/potential difference after passing through a resistance by output current:
<br/><br/>
This seventh calculator is similar to the sixth, but works from output current as opposed to potential difference.
<br/><br/><br/>
Power in (Watts): <input type="number" id="powin49" value="289" onclick="check()" onchange="check()">
Power out (Watts): <input type="number" id="powout49" value="289" onclick="check()" onchange="check()">
Current out (Amperes): <input type="number" id="curout49" value="4913" onclick="check()" onchange="check()">
Significant figures: <input type="number" id="sigin49" value="5" onclick="check()" onchange="check()"> <button onclick="calcthrores2()">CALCULATE RESISTANCE THE POWER WENT THROUGH</button>
<span id="resout49"></span>
<br/><br/><br/>
Potential difference required to push a current through resistance:
<br/><br/>
This calculator will simply work out how much potential difference is needed to push a current through a certain resistance.
<br/><br/><br/>
Resistance (Ohms): <input type="number" id="resin491" value="289" onclick="check()" onchange="check()">
Current (Amperes): <input type="number" id="curin491" value="4913" onclick="check()" onchange="check()">
Significant figures: <input type="number" id="sigin491" value="5" onclick="check()" onchange="check()"> <button onclick="calcpotneed()">CALCULATE THE NEEDED POTENTIAL DIFFERENCE</button>
<span id="potout491"></span>
<br/><br/><span id="hidecookie"><a id="switch" href="javascript:dark()">Go dark</a> <a href="javascript:rememberdark()">Always use dark theme (extremely small cookie)</a> </span><a id="delete" style="visibility:hidden" href="javascript:eraseCookie()">Delete dark theme cookie</a>
<script>
current2 = 1
cur289 = parseFloat(document.getElementById("curin289").value);
pot289 = parseFloat(document.getElementById("potin289").value);
res289 = parseFloat(document.getElementById("resin289").value);
prec289 = parseFloat(document.getElementById("sigin289").value);
powin4913 = parseFloat(document.getElementById("powin4913").value);
powout4913 = parseFloat(document.getElementById("powout4913").value);
potin4913 = parseFloat(document.getElementById("potin4913").value);
prec4913 = parseFloat(document.getElementById("sigin4913").value);
powin49 = parseFloat(document.getElementById("powin49").value);
powout49 = parseFloat(document.getElementById("powout49").value);
curout49 = parseFloat(document.getElementById("curout49").value);
prec491 = parseFloat(document.getElementById("sigin491").value);
resin491 = parseFloat(document.getElementById("resin491").value);
curin491 = parseFloat(document.getElementById("curin491").value);
prec49 = parseFloat(document.getElementById("sigin49").value);
cur17 = parseFloat(document.getElementById("curin17").value);
pot17 = parseFloat(document.getElementById("potin17").value);
prec17 = parseFloat(document.getElementById("sigin17").value);
res = parseFloat(document.getElementById("resin").value);
power = parseFloat(document.getElementById("powin").value);
prec = parseFloat(document.getElementById("sigin").value);
res107 = parseFloat(document.getElementById("resin1.7").value);
cur107 = parseFloat(document.getElementById("curin1.7").value);
prec107 = parseFloat(document.getElementById("sigin1.7").value);
res117 = parseFloat(document.getElementById("resin117").value);
pot117 = parseFloat(document.getElementById("potin117").value);
prec117 = parseFloat(document.getElementById("sigin117").value);
function check() {
res = parseFloat(document.getElementById("resin").value);
power = parseFloat(document.getElementById("powin").value);
prec = parseFloat(document.getElementById("sigin").value);
cur17 = parseFloat(document.getElementById("curin17").value);
pot17 = parseFloat(document.getElementById("potin17").value);
prec17 = parseFloat(document.getElementById("sigin17").value);
cur289 = parseFloat(document.getElementById("curin289").value);
pot289 = parseFloat(document.getElementById("potin289").value);
res289 = parseFloat(document.getElementById("resin289").value);
prec289 = parseFloat(document.getElementById("sigin289").value);
powin4913 = parseFloat(document.getElementById("powin4913").value);
powout4913 = parseFloat(document.getElementById("powout4913").value);
potin4913 = parseFloat(document.getElementById("potin4913").value);
prec4913 = parseFloat(document.getElementById("sigin4913").value);
powin49 = parseFloat(document.getElementById("powin49").value);
powout49 = parseFloat(document.getElementById("powout49").value);
curout49 = parseFloat(document.getElementById("curout49").value);
prec49 = parseFloat(document.getElementById("sigin49").value);
res107 = parseFloat(document.getElementById("resin1.7").value);
cur107 = parseFloat(document.getElementById("curin1.7").value);
prec107 = parseFloat(document.getElementById("sigin1.7").value);
res117 = parseFloat(document.getElementById("resin117").value);
pot117 = parseFloat(document.getElementById("potin117").value);
prec117 = parseFloat(document.getElementById("sigin117").value);
prec491 = parseFloat(document.getElementById("sigin491").value);
resin491 = parseFloat(document.getElementById("resin491").value);
curin491 = parseFloat(document.getElementById("curin491").value);
}
high = 0
high2 = 0
high1 = 0
high3 = 0
high4 = 0
now = 0
current = 0
function calcdanger() {
current2 = Math.sqrt(power/res) //4.123105626
pot = power/current2 //1191.577525804
now = current2
high = now
high1 = pot
high2 = current2
high3 = Math.pow(now,2)*res
high4 = high3/now
// document.getElementById("count").innerHTML=Math.floor(((current-(power/accuracy))/current2)*10000)/100 + "% calculated"
dangerout()
}
function dangerout(){
document.getElementById("current").innerHTML=high2.toPrecision(prec) + " amperes and "
document.getElementById("pot").innerHTML=high1.toPrecision(prec) + " volts is the most dangerous possible input. This results in an output of "
document.getElementById("output").innerHTML=high.toPrecision(prec) + " amperes, "
document.getElementById("output2").innerHTML=high3.toPrecision(prec) + " watts and "
document.getElementById("output3").innerHTML=high4.toPrecision(prec) + " volts. "
document.getElementById("count").innerHTML=""
if (high <= 0.071) {
document.getElementById("acdc").innerHTML="Direct current would likely be more dangerous to a human."
}
else if (high > 0.1 && high < 0.2) {
document.getElementById("acdc").innerHTML="Both direct current and alternating current are likely to be fatal to a human."
}
else {
document.getElementById("acdc").innerHTML="Alternating current would likely be more dangerous to a human."
}
}
function calcdanger2() {
power107 = Math.pow(cur107,2)*res107
current2107 = Math.sqrt(power107/res107)
pot107 = power107/current2107
now107 = current2107
high107 = now107
high1107 = pot107
high2107 = current2107
high3107 = Math.pow(now107,2)*res107
high4107 = high3107/now107
dangerout2()
}
function dangerout2(){
document.getElementById("current1.7").innerHTML=high2107.toPrecision(prec107) + " amperes and "
document.getElementById("pot1.7").innerHTML=high1107.toPrecision(prec107) + " volts is the most dangerous possible input. This results in an output of "
document.getElementById("output1.7").innerHTML=high107.toPrecision(prec107) + " amperes, "
document.getElementById("output21.7").innerHTML=high3107.toPrecision(prec107) + " watts and "
document.getElementById("output31.7").innerHTML=high4107.toPrecision(prec107) + " volts. "
}
function calcdanger3() {
power117 = (pot117/res117)*pot117
current2117 = Math.sqrt(power117/res117)
pot117 = power117/current2117
now117 = current2117
high117 = now117
high1117 = pot117
high2117 = current2117
high3117 = Math.pow(now117,2)*res117
high4117 = high3117/now117
dangerout3()
}
function dangerout3(){
document.getElementById("current117").innerHTML=high2117.toPrecision(prec117) + " amperes and "
document.getElementById("pot117").innerHTML=high1117.toPrecision(prec117) + " volts is the most dangerous possible input. This results in an output of "
document.getElementById("output117").innerHTML=high117.toPrecision(prec117) + " amperes, "
document.getElementById("output2117").innerHTML=high3117.toPrecision(prec117) + " watts and "
document.getElementById("output3117").innerHTML=high4117.toPrecision(prec117) + " volts. "
}
function calcmaxres(){
out17 = (pot17*cur17)/Math.pow(cur17,2)
document.getElementById("resout17").innerHTML=out17.toPrecision(prec17) + " ohms is the maximum resistance."
}
function calcaftres(){
cur2289 = pot289/res289
if (cur2289 >= cur289){
curout289 = cur289
pow289 = cur289*pot289
}
if (cur2289 < cur289){
curout289 = cur2289
pow289 = Math.pow(curout289,2)*res289
}
pot2289 = pow289/curout289
document.getElementById("curout289").innerHTML=curout289.toPrecision(prec289) + " amperes of current and "
document.getElementById("potout289").innerHTML=pot2289.toPrecision(prec289) + " volts of potential difference would output, resulting in a power of "
document.getElementById("powout289").innerHTML=pow289.toPrecision(prec289) + " watts. "
}
function calcthrores(){
cur4913 = powout4913/potin4913
badres4913 = potin4913/(powin4913/potin4913)
res4913 = potin4913/cur4913
if (powin4913 == powout4913){
document.getElementById("resout4913").innerHTML= "The resistance was between 0 and " + badres4913.toPrecision(prec4913) + " ohms."
}
if (powin4913 < powout4913){
document.getElementById("resout4913").innerHTML= "Stop being a ๓ฬ๓ค."
}
if (powin4913 > powout4913){
document.getElementById("resout4913").innerHTML= "The resistance was " + res4913.toPrecision(prec4913) + " ohms."
}
}
function calcthrores2(){
potin49 = powout49/curout49
badres49 = potin49/(powin49/potin49)
res49 = potin49/curout49
if (powin49 == powout49){
document.getElementById("resout49").innerHTML= "The resistance was between 0 and " + badres49.toPrecision(prec49) + " ohms."
}
if (powin49 < powout49){
document.getElementById("resout49").innerHTML= "Stop being a ๓ฬ๓ค."
}
if (powin49 > powout49){
document.getElementById("resout49").innerHTML= "The resistance was " + res49.toPrecision(prec49) + " ohms."
}
}
function calcpotneed(){
potout491 = curin491*resin491
document.getElementById("potout491").innerHTML= potout491.toPrecision(prec491) + " volts of potential difference are needed."
}
function darktheme()
{
document.body.style.backgroundColor = "black";
document.body.style.color = "white";
}
function dark()
{
darktheme()
document.getElementById("switch").href = "javascript:location.reload()"
document.getElementById("switch").innerHTML = "Go light"
document.getElementById("switch").style.color = "white"
}
function setCookie(cname,cvalue,exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
var expires = "expires=" + d.toGMTString();
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for(var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
function eraseCookie() {
setCookie('dark1','true1',-1);
location.reload()
}
function rememberdark(){
setCookie('dark1','true1',999);
location.reload()
}
var user = getCookie("dark1");
if (user != "") {
window.open("javascript:dark()","_self")
document.getElementById("hidecookie").innerHTML = ""
document.getElementById("delete").style.visibility = "visible"
}
</script>
</body></html>