Generalization of ellipse in matrix representation

2k Views Asked by At

Ellipsoids (and conics in general) can be represented in Matrix form

$ Q =\begin{bmatrix} A & B & D \\ B & C & E \\ D & E & F \end{bmatrix} $

at a given location with a column vector $x$. From this, the equation

$x^TQx = 0$ (Eq. 1)

can be derived to represent this ellipsoid (or conic) as an equation. several sources (wikipedia and MTU) represent $x$ as $ \begin{bmatrix} x \\ y \\ 1 \end{bmatrix} $ while I would have expected $ \begin{bmatrix} x \\ y \\ z \end{bmatrix} $ (note the $z$ instead of $1$). They claim to do this for projection purposes.

My question is, if I want a general representation, ie with the vector $x$ having three arbitrary components, can I simply use the afore mentioned Eq. 1 again?

The result would be

$[x(Ax+By+Dz)+y(Bx+Cy+Ez)+z(Dx+Ey+Fz)] = 0$

1

There are 1 best solutions below

0
On BEST ANSWER

I think that you might be overlooking the fact that the matrix form of the quadric equation isn’t always $\mathbf x^TQ\mathbf x=0$. If you have $\mathbf x = [x,y,z]^T$, then the zero vector satisfies this equation, so it can only represent quadrics that pass through the origin. I’ll illustrate with conics in $\mathbb R^2$. The generalization to higher dimensions should be obvious.

The matrix product $\mathbf x^TQ\mathbf x$ is a sum of products of pairs of elements of $\mathbf x$. This gives you basically two choices about how to represent the general plane conic equation $Ax^2+Bxy+Cy^2+Dx+Ey+F=0$ in matrix form. If you use inhomogeneous Cartesian coordinate vectors $\mathbf x = [x,y]^T$, then the best you can do is $$\begin{bmatrix}x&y\end{bmatrix} \begin{bmatrix}A&\frac B2\\\frac B2&C\end{bmatrix} \begin{bmatrix}x\\y\end{bmatrix} + \begin{bmatrix}D&E\end{bmatrix}\begin{bmatrix}x\\y\end{bmatrix}+F = 0, \tag1$$ which you’ll often see presented as $\mathbf x^TQ\mathbf x+\mathbf b^Tx+c=0$. If this equation represents an ellipse or hyperbola centered at the origin, the linear terms will be zero ($D=E=0$), but then $c$ must be nonzero for the conic not to degenerate to a point or pair of intersecting lines. In that case, you can normalize by dividing through by $c$ to get the more standard-looking $\mathbf xQ'\mathbf x=1$. The important take-away for the present discussion is that only the quadratic part of the general equation can be represented in the form $\mathbf x^TQ\mathbf x$ if $\mathbf x$ is an inhomogeneous Cartesian coordinate vector.

Just as you might pass to homogeneous coordinates in order to represent any affine transformations as a simple matrix multiplication, we can pass to homogeneous coordinates to rewrite the general conic equation as a quadratic form. Setting $\mathbf x = [x,y,1]^T$, the equation then takes the form $$\begin{bmatrix}x&y&1\end{bmatrix} \begin{bmatrix}A&\frac B2&\frac D2\\\frac B2&C&\frac E2\\\frac D2&\frac E2&F\end{bmatrix} \begin{bmatrix}x\\y\\1\end{bmatrix} = 0, \tag2$$ or more succinctly, $\mathbf x^TQ\mathbf x=0$. Lest this seem like a cheap computational trick, remember that introducing homogeneous coordinates is tantamount to moving from the Euclidean plane $\mathbb R^2$ to the projective plane $\mathbb{RP}^2$. Any nonzero multiple $k\mathbf x$ of $\mathbf x$ represents the same point, and sure enough, $(k\mathbf x)^TQ(k\mathbf x)=k^2(\mathbf x^TQ\mathbf x)=0$. Similarly, you can scale $Q$ by any nonzero factor without affecting the conic that it represents. Since we’re now on the projective plane, we don’t have to limit ourselves to finite points (with nonzero last coordinate), either. If we allow $\mathbf x = [x,y,w]^T$ to be any non-zero coordinate triple, then $\mathbf x^TQ\mathbf x=0$ expands into the homogeneous second-degree equation $$Ax^2+Bxy+Cy^2+Dxw+Eyw+Fw^2=0,$$ which is the homogenization of the general conic equation we started with. Relating back to the point made earlier, homogenizing the conic equation turns it into a quadratic form, which can be represented by a single matrix.

As a final note, as I mentioned at the beginning, the origin is always a solution of the homogeneous equation $\mathbf x^TQ\mathbf x=0$. So, in the usual model of $\mathbb{RP}^2$ as a plane in $\mathbb R^3$—commonly the plane $z=1$—this equation represents a quadric surface that passes through the origin. The plane conic that it represents is the intersection of this surface with the distinguished plane in the model.