• Have Any Question?
  • contact@eitworld.com

Ellipse() Function





ellipse() function is used to draw an ellipse with center (X,Y) on the screen.

void ellipse(int x, int y, int stangle, int endangle, int xradius, int yradius);
  • ellipse() function contains six parameters x, y, stangle, endangle, xradius and yradius.
  • x and y specifies the x and y coordinates and (x,y) specifies the center of the ellipse.
  • stangle and endangle specifies start angle and end angle of the ellipse. To draw full ellipse stangle must be 0 and endangle must be 360.
  • xradius specifies x-radius of the ellipse and yradius specifies y-radius of the ellipse.

Program

#include<stdio.h>

#include<conio.h>

#include<graphics.h>

void main()

{

int gd=DETECT, gm;

initgraph(&gd,&gm,” “);

ellipse(320,240,0,240,50,100);

getch();

closegraph();

}

Above program is used to draw a semi ellipse of X-radius 50 cm and Y-radius 100 cm with start angle 0 and end angle 240 degree at position (320,240). If you want to draw full ellipse then start angle must be 0 and end angle must be 360.

Output

ellipse



Real Time Web Analytics