Skip to content

Instantly share code, notes, and snippets.

@inwaves
Forked from antimatter15/ Smiley Face.carbide.md
Created December 22, 2020 13:26
Show Gist options
  • Save inwaves/257fecdddf53d2131b883b8da2ac3589 to your computer and use it in GitHub Desktop.
Save inwaves/257fecdddf53d2131b883b8da2ac3589 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(79, 47, 53, theta, Math.PI - theta)
ctx.stroke()
}
circle(80, 75, 50)
circle(64, 63, 12)
circle(116, 63, 12)
mouth(0.6563)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment