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 an ellipse divided by straight line into two colored part in C++ Graphics
- How to discretize an Ellipse or Circle to a Polygon using 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 smiley face using Graphics in C language
- Draw a triangle in C++ graphics
- Draw a circle without floating point arithmetic
- Biggest Reuleaux Triangle inscribed within a square which is inscribed within an ellipse
- Midpoint ellipse drawing algorithm
- DDA Line generation Algorithm in Computer Graphics
- Creating a Rainbow using Graphics Programming in C
- Point Clipping Algorithm in Computer Graphics
- How to add "graphics.h" C/C++ library to gcc compiler in Linux
- 2D Transformation in Computer Graphics | Set 1 (Scaling of Objects)
- Translation of objects in computer graphics
- Sierpinski Triangle using Graphics
- Vector vs Raster Graphics
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.