Suppose you are given two points $\mathbf p_1$ and $\mathbf p_2$ in the plane with associated vectors $\mathbf v_1$ and $\mathbf v_2$. You want to find an ellipse passing through $\mathbf p_1$ tangent to $\mathbf v_1$ and through $\mathbf p_2$ tangent to $\mathbf v_2$. There are infinitely many solutions,

but a natural choice is to take the one that is the closest to a circle, i.e. the one with the minimum eccentricity. Is there an elegant way to compute such an ellipse given $(\mathbf p_1, \mathbf v_1)$ and $(\mathbf p_2, \mathbf v_2)$?

In an answer to a previous not-quite-duplicate question, achille hui has given an elegant coordinate-free solution, which I summarize below.
Choose the origin at the intersection of the two desired tangent lines, so that $\mathbf p_1$ and $\mathbf p_2$ are interpreted as vectors from the intersection to the two input points. Let $\mathbf q_1,\mathbf q_2$ be the dual basis for $\mathbf p_1,\mathbf p_2$, that is, $\mathbf p_1\cdot \mathbf q_1 = \mathbf p_2\cdot \mathbf q_2 = 1$ and $\mathbf p_1\cdot \mathbf q_2 = \mathbf p_2\cdot \mathbf q_1 = 0$. The equation for the minimum-eccentricity ellipse is $$(\mathbf{q}_1\cdot \mathbf{x} - 1)^2 + (\mathbf{q}_2\cdot \mathbf{x} - 1)^2 + 2\alpha(\mathbf{q}_1\cdot \mathbf{x})(\mathbf{q}_2\cdot \mathbf{x}) = 1,$$ where $$\alpha = \frac{2\mathbf{p}_1\cdot\mathbf{p}_2}{\|\mathbf{p}_1\|^2 + \|\mathbf{p}_2\|^2}.$$
For the derivation, see the original post.