- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample3.html
More file actions
37 lines (36 loc) · 802 Bytes
/
example3.html
File metadata and controls
37 lines (36 loc) · 802 Bytes
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
<!DOCTYPE html>
<html>
<head>
<title>Spline Editor example</title>
<script src="jquery.min.js"></script>
<script src="underscore-min.js"></script> <!-- filter, map etc. -->
<script src="sylvester.js"></script> <!-- matrix inverse -->
<script src="spline-editor.js"></script>
<style>
div {
border:solid 1px black;
margin:20px;
width:320px;
height:256px;
}
</style>
</head>
<body>
<div id="splineEditorDiv"></div>
<span id="y-value"></span>
<script>
$('div').splineEditor({
initialKnots: [
[100, 140],
[160, 100],
[220, 140]
]
});
setInterval(function () {
var x = 120;
var y = $('div').splineEditor('getY', x);
$('#y-value').text('Interpolated value at ' + x + ' is ' + y);
}, 50);
</script>
</body>
</html>