arc()
Shape / 2D PrimitivesDescription
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
| Name | Type | Description |
|---|---|---|
| cx | float | x-coordinate of the center |
| cy | float | y-coordinate of the center |
| w | float | width of the arc |
| h | float | height of the arc |
| start | float | angle to start the arc (radians) |
| stop | float | angle to stop the arc (radians) |
| mode | int | OPEN, CHORD, or PIE (optional) |
Returns
voidRelated
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);