Principal axes of deformed ellipsoid

linear-transformations

I have a transformation matrix $T$ which stretches and rotates the unit sphere into an ellipsoid. I have a second, diagonal matrix
$$S=\begin{bmatrix}s_x&0&0\\
0&s_y&0\\
0&0&s_z
\end{bmatrix}$$

which then stretches the first ellipsoid into another one. I need to find the principle axis directions and lengths of the second ellipsoid.

My first thought was to compose the two matrices
$$T'=ST$$
and find the eigenvalues and eigenvectors of $T'$, but this just gave the axes of the first ellipsoid deformed by $S$. (This seems obvious in hindsight, since the composition preserves the complete mapping, not just the resulting shape.)

My second thought is to work out the algebraic equation of the ellipsoid described by $T'$ and massage it back into a standard form.

Can anyone help?

Best Answer

The equation $Ax^2+By^2+Cz^2+Exy+Fxz+Gyz=1$ of a quadric surface can be expressed in matrix form as $$\begin{bmatrix}x&y&z\end{bmatrix} \begin{bmatrix}A&\frac E2&\frac F2\\\frac E2&B&\frac G2\\\frac F2&\frac G2&C\end{bmatrix} \begin{bmatrix}x\\y\\z\end{bmatrix} = \mathbf x^TQ\mathbf x = 1.$$ The symmetric matrix $Q$ can be said to represent the quadric.† In particular, the unit sphere is represented by the identity matrix.

The principal axis theorem tells us that there’s an orthonormal basis of eigenvectors of $Q$ that gives the axes of this quadric and that the half-axis lengths are given by the reciprocal square roots of the (absolute values) of the corresponding eigenvalues: after a change of basis that’s an isometry because the basis is orthonormal, the equation of the quadric takes the form $\lambda_1{x'}^2+\lambda_2{y'}^2+\lambda_3{z'}^2=1$.

Given the invertible point transformation $\mathbf x'=M\mathbf x$, we have $$\mathbf x^TQ\mathbf x = (M^{-1}\mathbf x')^T Q (M^{-1}\mathbf x') = {\mathbf x'}^T (M^{-T}QM^{-1}) \mathbf x',$$ so the quadric transforms as $Q' = M^{-T}QM^{-1}$. In your case, $M=ST$, so when we transform the unit sphere $Q=I$, we get $$Q' = M^{-T}QM^{-1} = (ST)^{-T}(ST)^{-1}.$$ The reciprocal square roots of the eigenvalues of this matrix then are the half-axis lengths of the resulting ellipsoid and the corresponding eigenvectors, chosen to form an orthogonal set in case of repeated eigenvalues, are its principal axes.


† The fully-general quadric equation that includes linear terms and and arbitrary constant term can also be represented by a single $4\times4$ matrix by using homogeneous coordinates. All of this applies to quadrics of any dimension.

Related Question