-
Notifications
You must be signed in to change notification settings - Fork 53
/
sin.html
40 lines (30 loc) · 910 Bytes
/
sin.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
<!DOCTYPE html>
<html>
<title>Creative Coding Yea!</title>
<head>
<meta charset="utf-8">
<script language="javascript" src="js/creative_coding.js"></script>
<script language="javascript" src="js/canvas.js"></script>
<link rel="stylesheet" href="css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
</head>
<body>
<script>
var ctx = createCanvas("canvas1");
var radius = 200;
function draw(){
ctx.background(0);
ctx.fillStyle = rgb(255,0,0);
console.log(degrees(Math.sin(frameCount)));
//x = Math.cos(angle) * radius;
//y = Math.cos(angle) * radius;
var x = w/2 + Math.cos(frameCount/50) * w/2;
//var y = h/2 + Math.sin(frameCount/10) * 100;
var y = h/2;
//console.log(x);
ctx.fillEllipse(x, y, 120, 120);
// console.log("mouseX:" + mouseX + " mouseY: " + mouseY);
} // end draw
</script>
</body>
</html>