Skip to content

Instantly share code, notes, and snippets.

@dtex
Forked from antimatter15/ Smiley Face.carbide.md
Created August 29, 2016 14:49
Show Gist options
  • Save dtex/60d823d1dd9fe07472efcdea908b6a31 to your computer and use it in GitHub Desktop.
Save dtex/60d823d1dd9fe07472efcdea908b6a31 to your computer and use it in GitHub Desktop.
Smiley Face
var canvas = document.createElement('canvas'),
ctx = canvas.getContext('2d')
function circle(x, y, r){
ctx.beginPath()
ctx.arc(x, y, r, 0, 2 * Math.PI)
ctx.stroke()
}
function mouth(theta){
ctx.beginPath()
ctx.arc(71, 75, 40, theta, Math.PI - theta)
ctx.stroke()
}
circle(72, 75, 62)
circle(52, 63, 19)
circle(100, 63, 12)
mouth(0.375)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment