Skip to content

Instantly share code, notes, and snippets.

@khris khris/kaist_chan.html
Last active Aug 29, 2015

Embed
What would you like to do?
넙죽이 머리 그리기 http://jsfiddle.net/khris/0goy12pL/
<!DOCTYPE html>
<html>
<head lang="ko">
<meta charset="UTF-8">
<title>넙죽이</title>
<script type="text/javascript">
function draw() {
var canvas = document.getElementById('kaist_chan');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(22, 160, 220, 1)';
ctx.beginPath();
var r = 500;
var b = r / 100 * 99;
var angle = Math.acos(b/r);
console.log(angle);
ctx.arc(150, b * 2, r, -Math.PI / 2 - angle, -Math.PI / 2 + angle, false);
ctx.arc(150, 0, r, Math.PI / 2 - angle, Math.PI / 2 + angle, false);
ctx.fill();
}
</script>
</head>
<body onload="draw()">
<canvas id="kaist_chan" width="1000" height="1000">
</canvas>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.