In this article, the task is to draw circles in two different subwindows using two different algorithms, and the circles are created using a single mouse click.
Approach:
- There are two subwindows and both of them use different algorithms to create circles.
- The left subwindow creates a circle using Midpoint Circle drawing algorithm and the right subwindow implements the concept of polar coordinates.
- A circle can be created anywhere on the console using a single left mouse click and the coordinates of the center of the circle created depends on the position of the click.
- To change the color of the circle, right-click on the mouse.
- After performing all operations, jump out of the program by simply pressing the Esc key on the keyboard.
Below is the implementation of the above approach:
Output:
👁 Image