VOOZH about

URL: https://www.geeksforgeeks.org/cpp/draw-circles-using-the-polar-coordinates-and-mid-point-circle-drawing-algorithm-in-the-same-console-using-opengl-in-cpp/

⇱ Draw circles using the polar coordinates and mid-point circle drawing algorithm on the same console using openGL in C++ - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Draw circles using the polar coordinates and mid-point circle drawing algorithm on the same console using openGL in C++

Last Updated : 26 Jul, 2025

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
Comment