/
41_apply.html
44 lines (36 loc) · 1.15 KB
/
41_apply.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Cindy JS</title>
<script type="text/javascript" src="../../build/js/Cindy.js"></script>
<script type="text/javascript" src="../../build/js/CindyGL.js"></script>
<link rel="stylesheet" href="../../css/cindy.css">
</head>
<body style="font-family:Arial;">
<h1>CindyJS: apply within CindyGL</h1>
<script id="csdraw" type="text/x-cindyscript">
colorplot(
a = [#.x, #.y,1];
apply(a, k, .5*sin(k))
);
</script>
<script id="csinit" type="text/x-cindyscript">
use("CindyGL");
</script>
<div id="CSCanvas"></div>
<script type="text/javascript">
CindyJS({canvasname:"CSCanvas",
scripts: "cs*",
geometry: [],
animation: {autoplay: true},
ports: [{
id: "CSCanvas",
width: 500,
height: 500,
transform: [ { visibleRect: [-10,-10, 10, 10] } ]
}]
});
</script>
</body>
</html>