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