Ellipse Drawing Algorithm – Brief Lecture Notes
1. Introduction
An ellipse is the locus of points whose distances to two fixed points (foci) sum to a constant.
2. Standard Equation
(x^2 / a^2) + (y^2 / b^2) = 1, a = semi■major axis, b = semi■minor axis.
3. Symmetry
Symmetric about both axes – compute points in one quadrant, mirror to others.
4. Midpoint Ellipse Algorithm
• Divide into two regions based on slope.
• Region 1 (slope < 1): iterate x, update decision parameter p1.
• Region 2 (slope ≥ 1): iterate y, update decision parameter p2.
Initial parameters:
p1 = b^2 – a^2·b + (1/4)·a^2
p2 = b^2(x+0.5)^2 + a^2(y−1)^2 − a^2·b^2
5. Pseudocode (high■level)
Start at (0, b); while 2b^2·x < 2a^2·y handle Region 1;
then while y ≥ 0 handle Region 2; plot four symmetric points each step.
6. Advantages
• Integer arithmetic → fast.
• Exploits symmetry → minimal calculations.
7. Applications
CAD, radar charts, image processing boundaries, UI widgets.