ellipse()
Shape / 2D PrimitivesDescription
Draws an ellipse (oval) to the screen. The first two parameters set the location, and the third and fourth parameters set the width and height.
Syntax
void ellipse(float cx, float cy, float w, float h)
Parameters
| Name | Type | Description |
|---|---|---|
| cx | float | x-coordinate of the center |
| cy | float | y-coordinate of the center |
| w | float | width of the ellipse |
| h | float | height of the ellipse |
Returns
voidRelated
Under the Hood
From Processing.h:
void ellipse(float x, float y, float w, float h);
void ellipse(float,float,float,float);
inline void ellipse(A x,B y,C w,D h2){ _api::ellipse((float)x,(float)y,(float)w,(float)h2);
void ellipse(float cx, float cy, float w, float h);
template<typename A,typename B,typename C,typename D,typename=std::enable_if_t<std::is_arithmetic_v<A>&&std::is_arithmetic_v<B>&&std::is_arithmetic_v<C>&&std::is_arithmetic_v<D>>>
void ellipse(A cx,B cy,C w,D h){ ellipse((float)cx,(float)cy,(float)w,(float)h);
inline void ellipse(float x,float y,float w,float h){ if(PApplet::g_papplet) PApplet::g_papplet->ellipse(x,y,w,h); }
inline void PGraphics::ellipse(float x, float y, float w2, float h2){ if(PApplet::g_papplet) PApplet::g_papplet->ellipse(x,y,w2,h2); }
Under the Hood
From Processing.cpp:
void PApplet::ellipse(float cx, float cy, float w, float h) {
float rx = w, ry = h;
resolveEllipse(cx, cy, rx, ry);
drawEllipseGeom(cx, cy, rx, ry);
}
ellipse(cx, cy, diameter, diameter);