[Math] Formula for ellipse with two tangents intersecting with two points

geometry

Assume that I have four points $P_1, P_2, P_3, P_4$. These points lie on the 2d plane and take the form $P_i = (x_i, y_i)$

Assume that I define line $L_{ij}$ as the line passing through $P_i$ and $P_j$.

How do I find the coefficients $a$ and $b$ in the equation for an ellipse $\frac{x^2}{a^2}+\frac{y^2}{b^2}=1$ such that the ellipse passes through points $P_2$ and $P_3$ AND has both tangent lines $L_{12}$ and $L_{34}$?

EDIT: I am using this formula to smooth a graph I'm drawing in python's matplotlib.pyplot. I have two line segments $L_{12}$ and $L_{34}$ that I need to draw a smooth connection through, and an ellipse seems like a good shape for this.

Best Answer

In a purely geometric fashion, given two tangents and two tangency points on them, enter image description here

the wanted ellipse can be constructed as the Steiner inellipse of $ABC$, where $A$ is given by the intersection of the given tangents and $B,C$ are given by the symmetric of $A$ with respect to the tangency points. In particular the center of the wanted ellipse lies at the centroid of $ABC$.

Related Question