# Decomposition of conic equation for two intersecting lines

By using homogeneous coordinates ${\bf x}=[x, y, 1]^T$, a conic section can be expressed by ${\bf x}^T {\bf C} {\bf x} = 0$ with ${\bf C}$ being a 3x3 symmetric matrix. A degenerate form of the conic section is the type "two intersecting lines". When the two lines are also given in homogeneous coordinates with ${\bf g}^T {\bf x}=0$ and ${\bf h}^T {\bf x}=0$, the conic is computed as $${\bf C} = {\bf g} {\bf h}^T + {\bf h} {\bf g}^T$$

How do I extract ${\bf g}$ and ${\bf h}$ from ${\bf C}$?

Interestingly, there seems to be a nice solution for the problem which I found in this Matlab script - however, without any proof. The conic matrix is decomposed using eigendecomposition with $${\bf C} = {\bf Q} {\bf \Lambda} {\bf Q}^-1$$ After that, the minimum and maximum eigenvalues $\lambda_1$ and $\lambda_2$, multiplied with the corresponding eigenvectors ${\bf q}_{\text{min}}$ and ${\bf q}_{\text{max}}$ give $${\bf q}_{\text{min}}'=\sqrt{|\lambda_{\text{min}}|} {\bf q}_{\text{min}}$$ $${\bf q}_{\text{max}}'=\sqrt{|\lambda_{\text{max}}|} {\bf q}_{\text{max}}$$ Scaled (and possibly interchanged) versions of ${\bf g}$ and ${\bf h}$ can then be computed with $${\bf g}' = {\bf q}_{\text{min}}' + {\bf q}_{\text{max}}'$$ $${\bf h}' = {\bf q}_{\text{min}}' - {\bf q}_{\text{max}}'$$

Has someone an idea how to derive or proof the solution?

## 1 Answer

The matrix $\mathbf C$ defines a family of hyperbolas $\mathbf x^T\mathbf C\mathbf x=k$ with common principal axes and asymptotes. The degenerate member of this family $\mathbf x^T\mathbf C\mathbf x=0$ consists of those asymptotes. The asymptotes of a hyperbola in standard position are $\frac xa\pm \frac yb=0$, so they have direction vectors $$\left(\frac1a,\pm\frac1b\right)=\frac1a(1,0)\pm \frac1b(0,1).$$ This has an obvious generalization to a rotated hyperbola: if $\mathbf v_{\text{maj}}$ and $\mathbf v_{\text{min}}$ are unit vectors that give the major (transverse) and minor axes, respectively, with corresponding half-axis lengths $a$ and $b$, its asymptotes have direction vectors $\frac1a\mathbf v_{\text{maj}}\pm\frac1b\mathbf v_{\text{min}}$. (We don’t really need unit vectors for this, but we must have $\|\mathbf v_{\text{maj}}\|=\|\mathbf v_{\text{min}}\|$.)

The eigenvectors of the matrix $\mathbf C$ are the conic’s principal axes and its eigenvalues are the reciprocal squares of the corresponding half-axis lengths, from which the method you found immediately follows.

There’s another method for decomposing such a matrix that doesn’t involve computing eigenvalue and eigenvectors. The idea is to find a skew-symmetric matrix $\mathbf M$ such that $\mathbf C+\mathbf M$ is a scalar multiple of $\mathbf g\mathbf h^T$. The lines can then be read directly from this rank-one matrix: they are a row and column of $\mathbf C+\mathbf M$ that correspond to a non-zero diagonal entry.

• Thank you for the comprehensive answer. Do you think there are problems when the lines are parallel? – J. Brauers Aug 4 '17 at 15:41
• @J.Brauers It works for parallel lines, too. From the point of view of perspective geometry, that’s just a pair of lines that intersect at infinity, so isn’t any different from “normal” case. It even works when the two lines are coincident, although in that case, you can read the line directly from $\mathbf C$ and skip computing the eigenvectors (the eigenvector of the non-zero eigenvalue is the line, though). – amd Aug 4 '17 at 23:54