ELLIPSE GENERATING ALGORITHMS
Properties of Ellipses
An ellipse is defined as the set of points such that the sum of the distances from two fixed positions (foci) is the same for all points.
If the distances to the two foci from any point P = (x, y) on the ellipse are labeled d1 and d2 then the general equation of an ellipse can be stated as
d1 + d2 = constant
Expressing distances d1 and d2 in terms of the focal coordinates F1 = (x1, y1)
and F2 = (x2, y2), we have
√ ((x - x1)2 + (y - y1)2) + √ ((x - x2)2 + (y - y2)2) = constant
By squaring this equation, isolating the remaining radical, and then squaring again, we can rewrite the general ellipse equation in the form Ax2+ By2 + Cxy + Dx + Ey + F = 0
The major axis is the straight line segment extending from one side of the ellipse to the other through the foci. The minor axis spans the shorter dimension of the ellipse, bisecting the major axis at the half way position (ellipse center) between the two foci.
If rx labels the semi major axis, and ry labels the semi minor axis, then the equation of the ellipse can be written as in terms of the ellipse center coordinates and parameters rx and ry as
(x-xc)2/rx2 + (y-yc)2/ry2 = l
Using polar coordinates r and 9, we can also describe the ellipse in standard position with the parametric equations:
x = xc + rx cosθ
y = yc +ry sinθ
Symmetry considerations can be used to further reduce computations.
An ellipse in standard position is symmetric between quadrants, but unlike a circle, it is not symmetric between the two octants of a quadrant. Thus, we must calculate pixel positions along the elliptical arc throughout one quadrant, the elliptical arc throughout one quadrant, then we obtain positions in the remaining three quadrants by symmetry.