-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathintroduction.html
47 lines (30 loc) · 1.05 KB
/
introduction.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
<html>
<head>
<title>MathCell - Introduction</title>
<link rel="stylesheet" type="text/css" href="style.css">
<style></style>
</head>
<body>
<script src="../build/mathcell.js"></script>
<p style="text-align: center; line-height: 2"><span style="font-size: 20pt">MathCell</span><br/>
a simple straightforward way to include interactive mathematics in a web page</p>
<div class="mathcell" style="height: 4in">
<script>
var parent = document.scripts[ document.scripts.length - 1 ].parentNode;
var id = generateId();
parent.id = id;
MathCell( id, [ { type: 'slider', min: 0, max: 2*Math.PI,
name: 'phase', label: 'phase' } ] );
parent.update = function( id ) {
var phase = +document.getElementById( id + 'phase' ).value;
var p1 = plot( x => Math.sin(x), [0, 2*Math.PI], { color: 'rgb(0,255,127)' } );
var p2 = plot( x => Math.cos(x-phase), [0, 2*Math.PI], { color: 'purple' } );
var data = [ p1, p2 ];
var config = { type: 'svg' };
evaluate( id, data, config );
}
parent.update( id );
</script>
</div>
</body>
</html>