I know in an convex quads,there are a family of inscribed ellipses.

What I want to know is when the semi-axis 'a' and four vertices are given, how to determine the rotation angle. There may be three solution at most.
Thanks in advance for your help.
I know in an convex quads,there are a family of inscribed ellipses.

What I want to know is when the semi-axis 'a' and four vertices are given, how to determine the rotation angle. There may be three solution at most.
Thanks in advance for your help.
Hint.
The ellipse
$$ E\to\cases{x = a\cos t\\ y = b\sin t} $$
submitted to a rotation $\theta$
$$ E_{\theta}\to\cases{x=a\cos t\cos\theta+b\sin t\sin\theta\\ y = b\cos t\sin\theta-a\cos t\sin\theta} $$
and in cartesian coordinates
$$ E_{\theta}\to \frac {1}{a^2}(x\cos\theta-y\sin\theta)^2+\frac{1}{b^2}(x\sin\theta+y\cos\theta)-1=0 $$
or
$$ q\cdot Q\cdot q - 1=0 $$
with $q = (x,y)$ and $Q = \left( \begin{array}{cc} \frac{\cos ^2\theta}{a^2}+\frac{\sin ^2\theta}{b^2} & \left(\frac{1}{b^2}-\frac{1}{a^2}\right) \sin\theta \cos\theta \\ \left(\frac{1}{b^2}-\frac{1}{a^2}\right) \sin\theta \cos\theta & \frac{\sin ^2\theta}{a^2}+\frac{\cos ^2\theta}{b^2} \\ \end{array} \right)$
now, given a set of points defining a convex quadrilateral, $P_i$ we can define a set of lines along the sides of this quadrilateral as
$$ \cases{ L_i\to q = P_i + \lambda_i\vec v_i\\ \vec v_i = P_{i+1}-P_i,\ \ i = \{1,2,3\},\ \ \ \vec v_4 = P_1-P_4 } $$
so the ellipse $(q-p_0)\cdot Q\cdot(q-p_0)=1$ should be tangent to all $L_i$. Here $q=(x,y)$ represents a generic point in the plane. The ellipse should verify
$$ (P_i-p_0+\lambda_i\vec v_i)\cdot Q\cdot(P_i-p_0+\lambda_i\vec v_i)-c^2=(P_i-p_0)\cdot Q\cdot(P_i-p_0)+2\lambda_i(P_i-p_0)\cdot Q\cdot\vec v_i +\lambda_i^2\vec v_i\cdot Q\cdot\vec v_i - 1 = 0 $$
due to tangency we should have
$$ \left((P_i-p_0)\cdot Q\cdot\vec v_i\right)^2-\left(\vec v_i\cdot Q\cdot\vec v_i\right)\left((P_i-p_0)\cdot Q\cdot(P_i-p_0)-1\right) = 0 $$
so we have the conditions:
$$ \left((P_i-p_0)\cdot Q\cdot\vec v_i\right)^2-\left(\vec v_i\cdot Q\cdot\vec v_i\right)\left((P_i-p_0)\cdot Q\cdot(P_i-p_0)-1\right)=0 $$
four equations and four unknowns $\{b,x_0,y_0,\theta\}$