-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.html
More file actions
39 lines (36 loc) · 1.21 KB
/
example.html
File metadata and controls
39 lines (36 loc) · 1.21 KB
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
<html>
<head>
<script src="matrix_processor.js"></script>
<script src="rpoly.js"></script>
<script src="polymovial.js"></script>
</head>
<body>
<p>
Move your mouse pointer around over the grey area. Every 5 seconds, the corresponding polynomial
of degree 5 will be computed and prediction will be made if the mouse pointer would have crossed / touched
the red area on the right. All output can be found in the console.
</p>
<table width="100%" height="100%">
<tr>
<td width="90%" height="100%">
<div id="polymovial-example" style="width:100%;height:90%;background-color:#EEEEEE">
</div>
</td>
<td width="10%">
<div id="banner" style="width:90%%;height:30%;background-color:#EE0000">
</div>
</td>
<tr>
</table>
<script language="JavaScript">
var polymovial = new polymovial('polymovial-example', 1024, 5, 10, matf);
window.setInterval(function(polymovial) {
console.log("Polynomial (past 5 seconds):");
var poly = polymovial.obtainPolynomial();
console.log(poly);
console.log("Mouse pointer would have crossed / touched the banner:");
console.log(polymovial.checkIntersection('banner', poly) ? "yes" : "no");
}, 5000, polymovial);
</script>
</body>
</html>