-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·92 lines (81 loc) · 3.74 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
<!DOCTYPE html>
<title>Billiard Simulation</title>
<meta charset="utf-8"/>
<code mode="text/html">
<html>
<head>
<!-- LOADING LIBRARIES -->
<!-- Load the Paper.js library -->
<script type="text/javascript" src="./Modules/paper-full.js"></script>
<!-- Load the Math.js library -->
<script type="text/javascript" src="./Modules/math.js"></script>
<script type="text/javascript" src="./Modules/FileSaver.js"></script>
<script type="text/javascript" src="./Modules/Chart.bundle.js"></script>
<!-- Define inlined PaperScript associate it with b_table -->
<script type="text/javascript" src="./Modules/myTable.js" canvas = "b_table"></script>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="window">
<!-- CANVAS FOR DRAWING -->
<canvas id="b_table" resize="true"></canvas>
</div>
<!-- TABLE -->
<center>
<div style="padding:5px">
<input type="radio" id="tron" name="table_shape" value="tron" checked>
<label for="tron">tron</label>
<input type="radio" id="rectangle" name="table_shape" value="rectangle">
<label for="rectangle">Rectangle</label>
<input type="radio" id="circle" name="table_shape" value="circle">
<label for="circle">circle</label> <input type="radio" id="polygon" name="table_shape" value="polygon">
<label for="polygon">polygon</label>
</div>
<button onclick="run()" id="run"> Run </button>
Number of Iterations: <input type="text" name="num_iter" value="100" id="num_iter" style='width:50px;'>
<div class="dropdown">
<button onclick="myFunction()" class="dropbtn">Add Pts / Clear All</button>
<div id="myDropdown" class="dropdown-content">
<a href="#" id="addPoint" onclick="addWall()">Add Wall</a>
<a href="#" id="clear" onclick="clearAll()">Clear All</a>
</div>
</div>
<button onclick="exportSVG()" id="export_svg">Export SVG</button>
<button onclick="exportStates()" id="export_states">Export States</button>
</center>
<table>
<tr>
<td>Gamma:</td>
<td><input type="text" name="gamma" value="0" id="gamma"></td>
</tr>
<td>Initial Position:</td>
<td>Red <input type="text" name="position" value="30, 30" id="position"></td>
<td>Blue <input type="text" name="position_blue" value="-30, -30" id="position_blue"></td>
</tr>
<tr>
<td>Initial Omega:</td>
<td>Red <input type="text" name="omega" value="1" id="omega"></td>
<td>Blue <input type="text" name="omega_blue" value="1" id="omega_blue"></td>
</tr>
<tr>
<td>Initial Heading:</td>
<td>Red <input type="text" name="heading" value="(0, 1)" id="heading"></td>
<td>Blue <input type="text" name="heading_blue" value="(0, 1)" id="heading_blue"></td>
</tr>
<tr>
<td class="slidecontainer" colspan=2>Red<input type="range" min="0" max="360" value="180" class="slider" id="theta" oninput="slideToVec(this.value)"></td>
<td class="slidecontainer" colspan=2>Blue<input type="range" min="0" max="360" value="180" class="slider" id="theta" oninput="slideToVec_blue(this.value)"></td>
</tr>
<tr>
<td> Width:</td>
<td><input type="text" name="table_width" value="600" id="table_width"></td>
<td>Height:</td>
<td><input type="text" name="table_height" value="300" id="table_height"></td>
</tr>
</table>
<!--CHART AREA -->
<div id='chart'>
<canvas id="chart_canvas" resize="true"></canvas>
</div>
</body>
</html>