# 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?

#### Solutions Collecting From Web of "Homography between ellipses"

You can map any non-degenerate conic (i.e. it doesn’t factor into two lines) and find a homography to any other non-degenerate conic. So you can even map ellipses to hyperbolas and the likes. The mapping won’t be unique, but leave you three real degrees of freedom even after both conics have been defined.

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.