Skip to main content

Coloured Circle using Midpoint Circle Algorithm

Coloured Circle using Midpoint Circle Algorithm

Drawing a Coloured 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 coloured circle using midpoint algorithm. Everything is same except you need to specify the colour in putpixel and run the entire logic in while loop and decrement r (radius).

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\\bgiin initgraph with just ""(2 double quotes).

Comments

Popular posts from this blog

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.

Bresenham's Line Algorithm (DASHED LINE)

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

Bresenham's Line Algorithm (DOTTED LINE)

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



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