-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
93 lines (92 loc) · 4.47 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="styles.css">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<title>Double-Slit Simulator</title>
</head>
<body>
<div class="simulation">
<div id="schemaBox">
<svg xmlns="http://www.w3.org/2000/svg" id="natural-light" height="400px">
</svg>
<svg xmlns="http://www.w3.org/2000/svg" id="ls-waves" height="400px">
</svg>
<svg xmlns="http://www.w3.org/2000/svg" id="waves" height="400px">
</svg>
<svg xmlns="http://www.w3.org/2000/svg" id="central-line" height="4px">
<line id="central-line__line" stroke-dasharray="20" stroke-width="4" x1="0" y1="2" x2="0" y2="2"
stroke="gray"></line>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" id="L-line" height="22px">
<path id="L-line__line" stroke-width="2" fill="none" stroke="gray"></path>
<text id="L-line__text" y="11" stroke="gray" fill="gray">L</text>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" id="D-line" width="30px">
<path id="D-line__line" stroke-width="2" d="" fill="none" stroke="gray"></path>
<line stroke-width="2" fill="none" stroke="gray" x1="10" y1="1" x2="30" y2="1"></line>
<line id="D-line__bottom-stand" stroke-width="2" fill="none" stroke="gray" x1="10" x2="30"></line>
<text id="D-line__text" x="0" stroke="gray" fill="gray">d</text>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" id="light-source" width="50px" height="400px"
viewBox="0 0 100 100" preserveAspectRatio="none">
<path d="M 40,0 v 49 h 20 v -49 Z M 40,100 v -49 h 20 v 49 Z" fill="black"></path>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" id="two-slits" width="50px" height="400px">
<rect id="two-slits_obstacle" x="20" y="0" height="400" width="10" fill="black"></rect>
<rect id="top-slit" x="19" y="116" height="8" width="12" fill="white"></rect>
<circle id="top-slit_dragger" class="slit-draggers" cx="25" cy="120" r="20" fill="rgba(0,0,0,0)"></circle>
<rect id="bottom-slit" x="19" y="276" height="8" width="12" fill="white"></rect>
<circle id="bottom-slit_dragger" class="slit-draggers" cx="25" cy="280" r="20"
fill="rgba(0,0,0,0)"></circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" id="screen" width="50px" height="400px"
viewBox="0 0 100 100" preserveAspectRatio="none">
<path d="M 40,0 v 100 h 20 v -100 Z" fill="black"></path>
</svg>
</div>
<div id="resultBox">
<svg xmlns="http://www.w3.org/2000/svg" id="interference-pattern" width="60px" height="400px"
viewBox="0 0 100 100" preserveAspectRatio="none">
</svg>
<svg xmlns="http://www.w3.org/2000/svg" id="interference-graph" width="60px" height="400px"
viewBox="0 0 100 100" preserveAspectRatio="none">
</svg>
</div>
</div>
<div class="info flex-row">
<div>
<label>
Adjust wavelength in Vacuum (380 nm - 780 nm) <br>
<input id="lambda-slider" type="range" class="customRange" min="380" max="780">
</label>
<div> L = <span id="L"></span></div>
<div> d = <span id="d"></span></div>
<div> λ = <span id="lambda"></span></div>
<div> δx = <span id="T"></span></div>
</div>
<div id="n-div">
<label>
Choose material
<select id="n-chooser">
<option value="1">Vacuum(1)</option>
<option value="1.33">Water(1.33)</option>
<option value="1.43">Sulphuric acid(1.43)</option>
<option value="1.52">Crown glass(1.52)</option>
<option value="1.65">Heavy flint glass(1.65)</option>
<option value="2.42">Diamond(2.42)</option>
<option value="1">Other</option>
</select>
</label> <br>
<label>
Or adjust the refractive index(n) (1 - 2.42) <br>
<input id="n-slider" type="range" class="customRange" min="1" max="2.42" step="0.01" value="1">
</label>
<div> n = <span id="n"></span></div>
<div> λ<sub>n</sub> = <span id="lambda_n"></span></div>
</div>
</div>
<script rel="script" src="script.js"></script>
</body>
</html>