arc()

Shape / 2D Primitives

Description

Draws an arc in the display window. Angles are given in radians.

Syntax

void arc(float cx, float cy, float w, float h, float start, float stop) void arc(float cx, float cy, float w, float h, float start, float stop, int mode)

Parameters

NameTypeDescription
cxfloatx-coordinate of the center
cyfloaty-coordinate of the center
wfloatwidth of the arc
hfloatheight of the arc
startfloatangle to start the arc (radians)
stopfloatangle to stop the arc (radians)
modeintOPEN, CHORD, or PIE (optional)

Returns

void

Related

Under the Hood

From Processing.h:

void arc(float,float,float,float,float,float); void arc(float,float,float,float,float,float,int); inline void arc(A x,B y,C w,D h2,E start,F stop){ _api::arc((float)x,(float)y,(float)w,(float)h2,(float)start,(float)stop); inline void arc(A x,B y,C w,D h2,E start,F stop,G mode){ _api::arc((float)x,(float)y,(float)w,(float)h2,(float)start,(float)stop,(int)mode); void arc(float cx, float cy, float w, float h, float start, float stop); void arc(float cx, float cy, float w, float h, float start, float stop, int mode); inline void arc(float x,float y,float w,float h,float s,float e){ if(PApplet::g_papplet) PApplet::g_papplet->arc(x,y,w,h,s,e); } inline void arc(float x,float y,float w,float h,float s,float e,int m){ if(PApplet::g_papplet) PApplet::g_papplet->arc(x,y,w,h,s,e,m); }

Under the Hood

From Processing.cpp:

void PApplet::arc(float cx, float cy, float w, float h, float startAngle, float endAngle) { float rx = w, ry = h; resolveEllipse(cx, cy, rx, ry); drawEllipseGeom(cx, cy, rx, ry, startAngle, endAngle); } void PApplet::arc(float cx, float cy, float w, float h, float startAngle, float endAngle, int /*mode*/) { // mode = OPEN / CHORD / PIE -- basic implementation uses OPEN arc(cx, cy, w, h, startAngle, endAngle); } arc(cx, cy, w, h, startAngle, endAngle);