-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharc.html
More file actions
44 lines (41 loc) · 1.43 KB
/
arc.html
File metadata and controls
44 lines (41 loc) · 1.43 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
40
41
42
43
44
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>HTML5 Canvas template</title>
<script type="text/javascript" src="js/jquery-2.0.3.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var canvas = document.getElementById('myCanvas');
var ctx = canvas.getContext('2d');
ctx.fillStyle = '#000000';
ctx.fillRect(0, 0, 500, 500);
ctx.beginPath();
ctx.strokeStyle = '#0000ff';
ctx.lineWidth = 5;
ctx.arc(250, 250, 80, (Math.PI/180)*0, (Math.PI/180)*360, false);
ctx.stroke();
ctx.closePath();
ctx.beginPath();
ctx.strokeStyle = '#ff0000';
ctx.lineWidth = 5;
ctx.arc(250, 250, 40, (Math.PI/180)*0, (Math.PI/180)*270, false);
ctx.stroke();
ctx.closePath();
ctx.beginPath();
ctx.strokeStyle = '#00ff00';
ctx.lineWidth = 5;
ctx.arc(250, 250, 120, (Math.PI/180)*0, (Math.PI/180)*270, true);
ctx.stroke();
ctx.closePath();
});
</script>
</head>
<body>
<div style="position: absolute; top: 50px; left: 50px;">
<canvas id="myCanvas" width="500" height="500">
Your browser does not support HTML5 canvas.
</canvas>
</div>
</body>
</html>