652aad4bly1g4gjxj3pr8j20u0140npe.jpg

Hi.

Welcome to my blog. This is Shinainai . I am a programmer . I live in California.I love art! I love STEM! Hope you have a nice stay!

HTML5 Canvas Tutorial5 - Arcs

HTML5 Canvas Tutorial5 - Arcs

Methods

beginPath():begins a path

arc(centerX, centerY, radius, startingAngle, endingAngle, counterclockwise):

  • draws an arc which is centered at (x, y) position

  • radius r starting at startAngle and ending at endAngle

  • anticlockwise (defaulting to clockwise)

stroke():draws the path on the canvas

Demo1

drawcircle.png

Try this code

drawcircle2.png

Demo2

drawarc.png

Try this code

drawarc2.png
Drawing + Coding = Flower

Drawing + Coding = Flower

HTML5 Canvas Tutorial4 - Lines

HTML5 Canvas Tutorial4 - Lines