đŸ§©Â arc() Syntax (p5.js)

arc(x, y, w, h, start, stop);


📍 What each parameter means

Parameter Meaning Think of it as
x x-position of center center left ↔ right
y y-position of center center up ↕ down
w width of ellipse how wide
h height of ellipse how tall
start start angle where the arc begins
stop stop angle where the arc ends

🧠 Angles in arc() (VERY important)

p5.js uses RADIANS, not degrees.

Angle Visual
0 points to the right →
PI / 2 down ↓
PI left ←
PI * 1.5 up ↑
TWO_PI full circle

So this:

arc(x, y, w, h, 0, PI);

draws the bottom half of a circle

(perfect for a smile 🙂)


🙂 Smiley Mouth Example

arc(x, y + 10, 40, 30, 0, PI);

Why this works: