-
Notifications
You must be signed in to change notification settings - Fork 1
/
linearmotion.html
167 lines (127 loc) · 5.46 KB
/
linearmotion.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="js/raphael.js"></script>
<script src="js/jquery-1.11.2.js"></script>
<script src="js/scale.js"></script>
<script src="js/linearmotion.js"></script>
<script src="js/placeholders.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/nav.css">
</head>
<body>
<div id="navbar">
<ul>
<li><a href="index.html">Index</a></li>
<li><a style="color:black; background-color:#A0A0A0" href="linearmotion.html">Linear motion</a><li>
<li><a href="projectiles.html">Projectiles</a><li>
<li><a href="relative.html">Relative velocity</a></li>
<li><a href="connected.html">Connected particles</a></li>
<li><a href="circular-shm.html">Circular and SHM</a></li>
<li><a href="collisions.html">Collisions</a></li>
</ul>
</div>
<div id="navselect">
<select id="navselectmenu" onchange="location = this.options[this.selectedIndex].value;">
<option value="linearmotion.html">Linear Motion</option>
<option value="projectiles.html">Projectiles</option>
<option value="relative.html">Relative Velocity</option>
<option value="connected.html">Connected Particles</option>
<option value="circular-shm.html">Circular and SHM</option>
<option value="collisions.html">Collisions</option>
<option value="index.html">Index</option>
</select>
</div>
<div style="position:absolute; width:165px;top:70px;">
<!-- DROPDOWN MENU -->
<div>Select scenario:</div>
<div style="height:10px;"></div>
<select id="typeSelect" onchange="typeChange()" autocomplete="off">
<option id="reachSpeed">Reach given speed</option>
<option id="slowToZero">Slow to zero</option>
<option id="catchup">Catchup</option>
</select>
<div style="height:5px;"></div>
<hr style = "float:left; width:85%;">
</br>
<!-- SHOWN WHEN "REACH GIVEN SPEED" IS SELECTED -->
<div id = "reach">
<input id="reach-u1" type="text" placeholder="Initial speed u ≥ 0" style = "float:left;width:87.5%;" autocomplete="off"/> </br>
<div style="height:5px;"></div>
<input id="reach-a1" type="text" placeholder="Acceleration a ≥ 0" style = "float:left;width:87.5%;" autocomplete="off"/> </br>
<div style="height:5px;"></div>
<input id="reach-v1" type="text" placeholder="Final velocity v > u" style = "float:left;width:87.5%;" autocomplete="off"/> </br>
<div style="height:5px;"></div>
<hr style = "float:left; width:85%;">
</br>
</div>
<!-- SHOW WHEN "SLOW TO ZERO" IS SELECTED -->
<div id = "slow" style="display:none;">
<input id="slow-u1" type="text" placeholder="Initial speed u > 0" style = "float:left;width:87.5%;" autocomplete="off"/> </br>
<div style="height:5px;"></div>
<input id="slow-a1" type="text" placeholder="Acceleration a < 0" style = "float:left;width:87.5%;" autocomplete="off"/> </br>
<div style="height:5px;"></div>
<hr style = "float:left; width:85%;">
</br>
</div>
<!-- SHOWN WHEN "CATCHUP" IS SELECTED -->
<div id = "catch" style="display:none;">
<!-- FIRST OBJECT -->
<input id="catch-a1" type="text" placeholder="Acceleration a1 > 0" style = "float:left;width:87.5%;" autocomplete="off"> </br>
<div style="height:15px;"></div>
<!-- SECOND OBJECT -->
<input id="catch-u2" type="text" placeholder="Initial speed u2 ≥ 0" style = "float:left;width:87.5%;" autocomplete="off"/> </br>
<div style="height:5px;"></div>
<input id="catch-a2" type="text" placeholder="Acceleration a2 ≥ 0" style = "float:left;width:87.5%;" autocomplete="off"> </br>
<div style="height:15px;"></div>
<input id="delay" type="text" placeholder="Delay x > 0" style = "float:left;width:87.5%;" autocomplete="off"/> </br>
<div style="height:5px;"></div>
<hr style = "float:left; width:85%;">
</br>
</div>
<!-- RUN BUTTON -->
<button onclick="run()" type="button">Run simulation</button>
<div style="height:5px;"></div>
<!-- STOP BUTTON -->
<button onclick="stopSimulation()" type="button">Stop simulation</button>
<div style="height:5px;"></div>
<!-- CLEAR INPUT BUTTON -->
<button onclick="clearInput()" type="button">Clear input</button>
<div style="height:5px;"></div>
<!-- HELP BUTTON -->
<button onclick="showHelp()" type="button">Help</button>
<div style="height:5px;"></div>
</div>
<!-- space for the graphics panel -->
<div id="graphics_panel" style="position:absolute; left:160px;width:600px;top:70px;"></div>
<!-- real time info relevant to the simulation -->
<div id ="info_pane" style="position:absolute;left:770px;width:250px;top:70px;height:345px;">
<div style="text-decoration: underline;">
First object:
</div>
<div id="iu1">Initial speed:</div>
<div id="ia1">Initial acceleration:</div>
<div id="is1">Initial position:</div>
<div id="cv1">Current velocity:</div>
<div id="cs1">Current position:</div>
</br>
<div style="text-decoration: underline;">
Second object:
</div>
<div id="iu2">Initial speed:</div>
<div id="ia2">Initial acceleration:</div>
<div id="is2">Initial position:</div>
<div id="cv2">Current velocity:</div>
<div id="cs2">Current position:</div>
</br>
<div style="text-decoration: underline;">
Other info:
</div>
<div id="time">Time:</div>
<div id="scale">Scale:</div>
</div>
<div id="graphText" style="position:absolute;left:770px;width:250px;top:415px;">Velocity vs time</div>
<div id="graph_panel" style="position:absolute;left:770px;width:225px;height:225px;top:435px;">
</div>
</body>
</html>