36. Eigenapplications, 2: Ellipses

36. Eigenapplications, 2: Ellipses

An ellipse is a curve in the plane: it looks like a squashed circle:

An ellipse with semimajor/minor axes a and b

The one in the diagram above has been squashed/stretched vertically/horizontally, and has equation x 2 a 2 + y 2 b 2 = 1 . Here, a is the biggest value that x can take (because if x = a then y has to be zero) and b is the biggest value that y can take. Suppose a > b . If you look at diameters (chords of the ellipse passing through the origin) then the longest will have length 2 a (pointing in the x -direction) and the shortest will have length 2 b (pointing vertically). We call a the semimajor axis and b the semiminor axis.

Suppose someone gives you an ellipse that has been squashed in some other direction. What is the equation for it? Conversely, if someone gives you the equation of an ellipse, how do you figure out the semimajor and semiminor axes?

General equation of an ellipse

What's the general equation of an ellipse? Assuming its centre of mass is at the origin, the general equation has the form A x 2 + B x y + C y 2 = 1 . If I wanted the centre of mass to be elsewhere, I could add terms like D x + E y .

The constants A , B , C can't be just anything. For example, if we take A = 1 , B = 0 , C = - 1 , then we get x 2 - y 2 = 1 , which is the equation of a hyperbola:

A hyperbola

The condition on A , B , C we need to get an ellipse is positive definiteness:

Definition:

The quadratic form A x 2 + B x y + C y 2 is positive definite if it's positive whenever we substitute in real numbers x , y other than 0 , 0 .

Definition:

An ellipse is a subset of 𝐑 2 cut out by the equation A x 2 + B x y + C y 2 = 1 where A , B , C are constants making the left-hand side positive definite.

Normal form for ellipses

Theorem:

Consider the matrix M := ( A B / 2 B / 2 C ) . Let u 1 , u 2 be unit length eigenvectors of M (with eigenvalues λ 1 , λ 2 ). Pick coordinates so that the new x - and y -axes point along the eigenvectors u 1 , u 2 (and so that u 1 sits at ( 1 , 0 ) and u 2 sits at ( 0 , 1 ) ). In these new coordinates, the equation of the ellipse becomes λ 1 x 2 + λ 2 y 2 = 1 .

This change of coordinates will actually be a rotation of the usual coordinates.

The matrix M arises as follows. Let v = ( x y ) . Then A x 2 + B x y + C y 2 = v T M v .

Lemma:

If λ 1 λ 2 then the eigenvectors u 1 and u 2 are orthogonal to one another. This works for any matrix M for which M T = M .

We have M u 1 = λ 1 u 1 and M u 2 = λ 2 u 2 . Consider u 1 T M u 2 . We have: u 1 T M u 2 = u 1 T λ 2 u 2 = λ 2 u 1 u 2 . We also have u 1 T M u 2 = u 1 T M T u 2 (because M T = M ), so u 1 T M u 2 = u 1 T M T u 2 = ( M u 1 ) T u 2 = λ 1 u 1 T u 2 = λ 1 u 1 u 2 . Therefore ( λ 1 - λ 2 ) u 1 u 2 = 0 . Since λ 1 λ 2 , we can divide by λ 1 - λ 2 and get u 1 u 2 = 0 .

This is why the change of coordinates in the theorem is just a rotation: your eigenvectors are orthogonal, so just rotate your x and y -directions until they point in these directions.

Proof of theorem

In the new coordinates (which I'm still calling x , y ), we have v = x u 1 + y u 2 , so: v T M v = ( x u 1 + y u 2 ) T M ( x u 1 + y u 2 ) = ( x u 1 + y u 2 ) T ( x λ 1 u 1 + y λ 2 u 2 ) = x 2 λ 1 + y 2 λ 2 , where we have used u 1 u 1 = u 2 u 2 = 1 and u 1 u 2 = 0 . This proves the theorem.

Semimajor and semiminor axes

The theorem tells us that the semimajor and semiminor axes point along the eigenvectors of M . Comparing the equations, we see that the semimajor and semiminor axes are a = 1 λ 1 and b = 1 λ 2 .

Example

Consider the ellipse 3 2 ( x 2 + y 2 ) - x y = 1 . The matrix M is M = ( 3 2 - 1 2 - 1 2 3 2 ) . This has characteristic polynomial det ( 3 / 2 - t - 1 / 2 - 1 / 2 3 / 2 - t ) = t 2 - 3 t + 2 , which has roots 3 ± 9 - 8 2 , i.e. λ 1 = 1 and λ 2 = 2 .

The unit eigenvectors are:

  • for λ 1 = 1 , u 1 = 1 2 ( 1 1 ) ,

  • for λ 2 = 2 , u 2 = 1 2 ( 1 - 1 ) .

What does this tell us? The semimajor and semiminor axes point in the u 1 - and u 2 -directions: rotated by 45 degrees from the usual axes. The lengths are a = 1 λ 1 = 1 and b = 1 λ 2 = 1 2 .

An ellipse with semimajor and minor axes 1 and 1/\sqrt{2}, with semimajor axis pointing in the (1,1)-direction

Ellipsoids

Exactly the same thing works in higher dimensions: an ellipsoid is given by Q ( x 1 , , x n ) = 1 where Q is a positive definite quadratic form, Q ( v ) = v T M v for some symmetric matrix M , and the ellipsoid is related to the standard ellipsoid x k 2 a k 2 = 1 by rotating so that the x 1 , , x n axes point along the eigendirections of M . The coefficients a k are given by 1 λ k where λ k are the eigenvalues.