Meet the Arc Function
We'll cover the following...
The way you draw a circle in your canvas
by using the handy arc
function. This function and the arguments you need to specify in order to use it look as follows:
Press + to interact
arc(centerX, centerY, radius, startAngle, endAngle, isAntiClockwise);
These arguments are important in helping you draw the circle that you want, so let’s look in detail what all of these arguments do.
centerX and centerY
The centerX
and centerY
arguments are pretty straightforward to understand. They specify where the center of your circle will be positioned inside the canvas:
Remember, the canvas lives in an inverted Cartesian system. What this means is that the x value increases as you move right, and the y value increases as you go down. This might be a little different than what you may remember from graphing equations in school. ...