# Homography between ellipses

This is a spin-off from a comment on Stack Overflow.

How can I find a homography between two ellipses in the plane?

A projective transformation (i.e. a homography) of $\mathbb{RP}^2$ is uniquely determined by four points and their images. You can start by choosing three points $A,B,C$ on the first conic, and corresponding image points $A',B',C'$ on the second. Choosing the preimage points by themselves tells you nothing about the mapping. Associating image points gives you one degree of freedom each, for choosing a point on a conic.
The fourth point $D$ might be chosen arbitrarily, but $D'$ has to be in a specific position in order to map the conic as a whole correctly. This is becuse four points don't define a conic yet, in general you need five there. The quantity which determines the correct choice for $D'$ is the cross ratio of the lines connecting $A,B,C,D$ to another point on the first conic. This cross ratio has to be the same as the cross ratio for $A',B',C',D'$ connected to a point on the second conic. So one way would be computing the cross ratio for $A,B,C,D$ then constructing $D'$ to match that value.
A more geometric approach does not compute the cross ratio, but instead construct a specific cross ratio, namely $-1$ so that you obtain a harmonic range. Here is a method to construct this: Construct tangents to the first conic in $A$ and $B$. Intersect these tangents, and connect the point of intersection with $C$. That line will intersect the conic in $C$ itself and one other point. Call this other point $D$. Do the same for the second conic to obtain $D'$. Then the uniquely determined homography from $A,B,C,D$ to $A',B',C',D'$ will map the first conic to the second.
• If I understood you correctly, your "more geometric approach" assumes that, given $A$ and $B$, I am able to find the correspondent $A'$ and $B'$. How can I solve the problem of estimating the homography without knowing that correspondences but just having the matrix representation of the first and the second ellipse? – Alessandro Jacopson Apr 7 '16 at 10:26
• @AlessandroJacopson: No, you misunderstood me: any points $A',B',C'$ on the second conic will work. At least if your objective is to find any homography between the two conics. If you need to find a specific homography, then you need to first specify additional constraints to choose that from among all the possible homographies which map one conic to the other. Of course, while “pick any point on the conic” is easy to say geometrically, if all you have is the matrix this still means e.g. finding a line that intersects the conic and computing the points of intersection. – MvG Apr 7 '16 at 11:13
• So in the first approach, you mean that given $A$, $B$, $C$, $D$ and a cross ratio (of lines connecting $A$, $B$, $C$, $D$ to the fifth point), the fifth point is uniquely determined? How can I prove that? – Zeng Jan 6 '20 at 2:13
• @Zeng: no, the cross tattoo does not determine the fifth point. It determines the conic as a whole. You can write $(A,B;C,D)_E=(A,B;C,D)_F$ indicating that the cross ratio for the lines connecting to $E$ is the same as for the lines to $F$, then show that this is equivalent to the equation for six points to lie on the same conic. But my statement in this answer was that if you have $A,B,C$ and $(A,B;C,D)_E$ for all $E$ on the conic, then $D$ is uniquely determined. The cross ratio determines line $DE$ and also $DF$ for $F$ another point on the conic. $D$ is the intersection of these lines. – MvG Jan 6 '20 at 6:54