The Journal of Online Mathematics and Its Applications, Volume 8 (2008)
The Most Marvelous Theorem in Mathematics, Dan Kalman

General Equation of an Ellipse

The standard equation for an ellipse, x2 / a2 + y2 / b2 = 1, represents an ellipse centered at the origin and with axes lying along the coordinate axes.  In general, an ellipse may be centered at any point, or have axes not parallel to the coordinate axes.  But such an ellipse can always be obtained by starting with one in the standard position, and applying a rotation and/or a translation.  For the most general formulation, we can include rotations through an angle of 0 (that is, no rotation at all) and translations by the zero vector (no translation at all).  Then every ellipse can be obtained by rotating and translating an ellipse in the standard position.  Accordingly, we can find the equation for any ellipse by applying rotations and translations to the standard equation of an ellipse.

It is a matter of choice whether we rotate and then translate, or the opposite.  To see this, let R represent a rotation, and consider what happens to a point x = (x, y) if we first translate by vector v, and then apply R.  The result will be R(x + v) = Rx + Rv, because R is linear.  But this is the same as first rotating x, and then translating by Rv.  This shows that every ellipse can be obtained from one in the standard position by either a rotation followed by a translation, or a translation followed by a rotation.  In developing a general equation for ellipses, we will use rotate then translate.

Rotation counterclockwise about the origin through an angle α carries (x, y) to (x cos αysin α, ycos α+x sin α) (derived here). The inverse operation can be obtained by rotating through 2π − α, and hence carries (x, y) to (x cos α + y sin α, y cos αx sin α). Applying the methods of  Equation of a Transformed Ellipse now leads to the following equation for a standard ellipse which has been rotated through an angle α.

Expanding the binomial squares and collecting like terms gives

(1)

which is in the form Ax2 + Bxy + Cy2 = 1, with A and C positive.  In this way we see that the equation for a rotated ellipse, centered at the origin is a quadratic with a nonzero xy term.

There is more to say. In the form Ax2 + Bxy + Cy2 = 1, we recognize  a generic quadratic equation.  If we factor out y2, we obtain (At2 + Bt + C) = 1 / y2, where t = x / y is the reciprocal of the slope from the origin to the point (x, y). This is valid for any point on the ellipse, except the x intercepts where y = 0.  At any other point, 1 / y2 is positive. Meanwhile t takes on all real values as the point (x, y) traces the ellipse between the two x intercepts. This shows that At2 + Bt + C can never equal 0.   Since At2 + Bt + C therefore has no real roots, we conclude that B2 − 4AC < 0.  And this conclusion is easily verified by computing B2 − 4AC = −4 / (ab)2 using the coefficients in equation (1).

We have seen that a rotated ellipse, centered at the origin, is always given by an equation of the form Ax2 + Bxy + Cy2 = 1, where A and C are positive, and B2 − 4AC < 0.  To complete the analysis of the general equation of an ellipse, note that translating a curve by a fixed vector (h, k) simply has the effect of replacing x by xh and y by yk in the equation for that curve (see  Equation of a Transformed Ellipse).  Accordingly, the general equation for a rotated ellipse centered at (h, k) has the form A(xh)2 + B(xh)(yk) + C(yk)2 = 1, again where A and C are positive, and B2 − 4AC < 0.  Must such an equation always represent an ellipse?  The answer is yes, as shown here.  Note also that expanding the general form of the translated ellipse will introduce, for the first time, x and y terms.  In fact the expanded version is

Ax2 + Bxy + Cy2 − (2Ah + kB)x − (2Ck + Bh)y + (Ah2 + Bhk + Ck2 − 1) = 0.

This reveals that the equation of an ellipse is always given by a quadratic polynomial in x and y, and that it is the presence of nonzero x or y terms that indicates a center other than at the origin.