Skip to main content

Circle using Midpoint Circle Algorithm

Circle using Midpoint Circle Algorithm


Drawing a Circle using Midpoint Circle Algorithm


In computer graphics, the midpoint circle algorithm is an algorithm used to determine the points needed for rasterizing a circle. Bresenham's circle algorithm is derived from the midpoint circle algorithm.
This algorithm is used to draw circle. But we can draw many shapes from it with little modifications in the formula.
Below is the code written in C to draw a circle using midpoint algorithm.

Code:

If you can't see the code, then Enable JavaScript in you browser

Output:




Note: Just copy the files "CGA.bgi" & "EGAVGA.bgi" from bgi folder to bin. So, if you have copied these 2 files then you can skip writing "C:\\tc\\bgi" in initgraph with just ""(2 double quotes).


Comments

Popular posts from this blog

Midpoint Ellipse Algorithm

Midpoint Ellipse Algorithm                  Midpoint ellipse algorithm is a method for drawing ellipses in computer graphics. This method is modified from Bresenham’s algorithm so it is sometimes known as Bresenham's circle algorithm.

Bresenham's Line Algorithm (THICK LINE)

Bresenham's Line Algorithm (THICK LINE) Bresenham's Line Algorithm (THICK LINE) The Bresenham algorithm is an incremental scan conversion algorithm.

Flood Fill Algorithm

Flood Fill Algorithm Flood Fill is a seed fill algorithm similar to Boundary Fill algorithm but sometimes when it is required to fill in an area that is not defined within a single color boundary we use flood fill instead of boundary fill.



Bestseller's in Electronics only at Amazon Best Selling Products on Amazon