graphics.h library is used to include and facilitate graphical operations in the program. graphics.h functions can be used to draw different shapes, display text in different fonts, change colours 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 colours using the available functions and fill them.
The idea is to decrease the angle(through which ellipse is going to slide) by an integral value and calculating the corresponding angle swiped by the circle’s radius using the ratio of their perimeters.
How to show the sliding on screen:
- Draw the Ellipse at calculated point using white color.
- Introduce some delay in function(in ms).
- Erase the previous Ellipse by drawing the Ellipse at same point using black color.
- Repeat from Step 1.
Below is the C++ representation of the above problem
- Draw ellipse in C graphics
- Draw circle in C graphics
- Draw a line in C++ graphics
- Draw Rectangle in C graphics
- Draw a moving car using computer graphics programming in C
- Draw a circle without floating point arithmetic
- Midpoint ellipse drawing algorithm
- bar() function in C graphics
- Segments in Computer Graphics
- How to include graphics.h in CodeBlocks?
- Applications of Computer Graphics
- bar3d() function in C graphics
- Vector vs Raster Graphics
- Computer Graphics | Antialiasing
- Computer Graphics | The RGB color model
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.