Program to draw ellipse in C using graphics.h header file.
graphics.h library is used to include and facilitate graphical operations in program. C graphics using graphics.h functions can be used to draw different shapes, display text in different fonts, change colors and many more. Using functions of graphics.h you can make graphics programs, animations, projects and games. You can draw circles, lines, rectangles, bars and many other geometrical figures. You can change their colors using the available functions and fill them.
Input : x=250, y=200, start_angle = 0, end_angle = 360, x_rad = 100, y_rad = 50 Output : Input : x=250, y=200, start_angle = 0, end_angle = 180, x_rad = 80, y_rad = 150 Output :
Explanation :The header file graphics.h contains ellipse() function which is described below :
void ellipse(int x, int y, int start_angle, int end_angle, int x_radius, int y_radius)
In this function x, y is the location of the ellipse. x_radius and y_radius decide the radius of form x and y.
start_angle is the starting point of angle and end_angle is the ending point of angle. The value of angle can vary from 0 to 360 degree.
- Draw an Ellipse rotating over a Circle in C++ graphics
- Draw circle in C graphics
- Draw Rectangle in C graphics
- Draw a line in C++ graphics
- Draw a moving car using computer graphics programming in C
- Midpoint ellipse drawing algorithm
- bar() function in C graphics
- Segments in Computer Graphics
- Applications of Computer Graphics
- Sierpinski Triangle using Graphics
- Computer Graphics | Antialiasing
- bar3d() function in C graphics
- Vector vs Raster Graphics
- How to include graphics.h in CodeBlocks?
- Draw a circle without floating point arithmetic
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.