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 x2a2+y2b2=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 2a (pointing in the x -direction) and the shortest will have length 2b (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 Ax2+Bxy+Cy2=1. If I wanted the centre of mass to be elsewhere, I could add terms like Dx+Ey .

The constants A,B,C can't be just anything. For example, if we take A=1 , B=0 , C=-1 , then we get x2-y2=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 Ax2+Bxy+Cy2 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 Ax2+Bxy+Cy2=1 where A,B,C are constants making the left-hand side positive definite.

Normal form for ellipses

Theorem:

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

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

The matrix M arises as follows. Let v=(xy) . Then Ax2+Bxy+Cy2=vTMv.

Lemma:

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

We have Mu1=λ1u1 and Mu2=λ2u2 . Consider uT1Mu2 . We have: uT1Mu2=uT1λ2u2 =λ2u1u2. We also have uT1Mu2=uT1MTu2 (because MT=M ), so uT1Mu2=uT1MTu2 =(Mu1)Tu2 =λ1uT1u2 =λ1u1u2. Therefore (λ1-λ2)u1u2=0 . Since λ1λ2 , we can divide by λ1-λ2 and get u1u2=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=xu1+yu2 , so: vTMv=(xu1+yu2)TM(xu1+yu2) =(xu1+yu2)T(xλ1u1+yλ2u2) =x2λ1+y2λ2, where we have used u1u1=u2u2=1 and u1u2=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 32(x2+y2)-xy=1. The matrix M is M=(32-12-1232). This has characteristic polynomial det(3/2-t-1/2-1/23/2-t)=t2-3t+2 , which has roots 3±9-82 , i.e. λ1=1 and λ2=2 .

The unit eigenvectors are:

  • for λ1=1 , u1=12(11) ,

  • for λ2=2 , u2=12(1-1) .

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

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(x1,,xn)=1 where Q is a positive definite quadratic form, Q(v)=vTMv for some symmetric matrix M , and the ellipsoid is related to the standard ellipsoid x2ka2k=1 by rotating so that the x1,,xn axes point along the eigendirections of M . The coefficients ak are given by 1λk where λk are the eigenvalues.