You are here

ellipse and fillellipse functions

Declarations:
void ellipse(int x, int y, int stangle, int endangle, int xradius, int yradius);

void fillellipse(int x, int y, int xradius, int yradius);

Ellipse function is used to draw an ellipse (x,y) are coordinates of center of the ellipse, stangle is the starting angle, end angle is the ending angle, and fifth and sixth parameters specifies the X and Y radius of the ellipse. To draw a complete ellipse stangle and end angle should be 0 and 360 respectively.

fillellipse draws an ellipse and fill it with current drawing color and pattern.

C programming code for ellipse

#include<graphics.h>

main()
{
   int gd = DETECT, gm;

   initgraph(&gd, &gm, "C:\\TC\\BGI");

   ellipse(100, 100, 0, 360, 50, 25);

   getch();
   closegraph();
   return 0;
}

C programming code for fillellipse

#include<graphics.h>

main()
{
   int gd = DETECT, gm;

   initgraph(&gd, &gm, "C:\\TC\\BGI");
   
   fillellipse(100, 100, 50, 25);

   getch();
   closegraph();
   return 0;
}