Skip to main content

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.
The advantage of this modified method is that only addition operations are required in the program loops. This leads to simple and fast implementation in all processors. The algorithm uses symmetry of ellipse and mid point algorithm to implement one quadrant only. We divide the quadrant into two regions and the boundary of two regions is the point at which the curve has a slope of -1. We proceed by taking unit steps in the x direction to the point P(where curve has a slope of -1), then taking unit steps in the y direction and applying midpoint algorithm at every step.

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

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