0

In a recent post I've investigated the inellipse of a triangle with the direction of its major axis and major to minor axes ratio specified.

In this problem, you're given a convex quadrilateral with known vertices, and your task is to find the inscribed ellipse that is tangent to all four sides of the quadrilateral. Since there is an infinite number of these ellipses, we have to narrow it down. So assume that you are also given the direction of the major or minor axis as the angle it makes with the $+x$-axis direction.

This is the task: Finding the equation of the ellipse under the given conditions.

I appreciate your input, comments, hints, and solutions.

My attempt:

Assume the vertices of the convex quadrilateral are the three points $\mathbf{p_1, p_2, p_3, p_4}$.

The equation of the ellipse to be found is

$ (\mathbf{r - C})^T Q (\mathbf{r - C}) = 1$

where $\mathbf{C}$ is the center of the ellipse.

From $ \mathbf{p_1, p_2, p_3, p_4}$ we can compute the normal vectors to the sides $\mathbf{p_1 p_2 , p_2 p_3 , p_3 p_4, p_4 p_1}$, let's call these $\mathbf{n_1, n_2, n_3, n_4} $ respectively.

Let the tangency points on these sides be $\mathbf{r_1, r_2, r_3, r_4}$ respectively.

Since the direction of the major axis is given as the angle $\theta$ it makes with $+x$ axis, then it has the form

$ Q = R D R^T $

where $ D = \begin{bmatrix} \dfrac{1}{a^2} && 0\\ 0 && \dfrac{1}{b^2} \end{bmatrix} $

And $ R = \begin{bmatrix} \cos \theta && - \sin \theta \\ \sin \theta && \cos \theta \end{bmatrix} $

Carrying out the multiplication, gives the following expression for $Q$:

$ Q = \begin{bmatrix} \dfrac{1}{a^2} \cos^2 \theta + \dfrac{1}{b^2} \sin^2 \theta && \sin \theta \cos \theta \left( \dfrac{1}{a^2} - \dfrac{1}{b^2} \right)\\ \sin \theta \cos \theta \left( \dfrac{1}{a^2} - \dfrac{1}{b^2} \right) && \dfrac{1}{a^2} \sin^2 \theta + \dfrac{1}{b^2} \cos^2 \theta \end{bmatrix} $

Note that

$ Q^{-1} = a^2 b^2 \begin{bmatrix} \dfrac{1}{a^2} \sin^2 \theta + \dfrac{1}{b^2} \cos^2 \theta && -\sin \theta \cos \theta \left( \dfrac{1}{a^2} - \dfrac{1}{b^2} \right)\\ -\sin \theta \cos \theta \left( \dfrac{1}{a^2} - \dfrac{1}{b^2} \right) && \dfrac{1}{a^2} \cos^2 \theta + \dfrac{1}{b^2} \sin^2 \theta \end{bmatrix} $

And this simplifies to

$ Q^{-1} = \begin{bmatrix} b^2 \sin^2 \theta + a^2 \cos^2 \theta && -\sin \theta \cos \theta \left( b^2 - a^2 \right)\\ -\sin \theta \cos \theta \left( b^2 - a^2 \right) && b^2 \cos^2 \theta + a^2 \sin^2 \theta \end{bmatrix} $

And this can written as

$ Q^{-1} = P = a^2 P_1 + b^2 P_2 $

where

$ P_1 = \begin{bmatrix} \cos^2 \theta && \sin \theta \cos \theta \\ \sin \theta \cos \theta && \sin^2 \theta \end{bmatrix} $

$ P_2 = \begin{bmatrix} \sin^2 \theta && - \sin \theta \cos \theta \\ - \sin \theta \cos \theta && \cos^2 \theta \end{bmatrix} $

Now the gradient vector at the tangency points $\mathbf{r_i}, i = 1,2,3,4 $ is given by

$ \mathbf{g_i} = 2 Q (\mathbf{r_i - C} ) $

And assuming the $\mathbf{n}_i $ are pointing outward from the triangle then we have

$ Q(\mathbf{r_i - C} ) = k_i \ \mathbf{n_i} $

From which

$ \mathbf{r_i - C} = k_i Q^{-1} \ \mathbf{n_i} = k_i P \ \mathbf{n_i} = k_i (a^2 P_1 + b^2 P_2) \ \mathbf{n_i}$

Substituting this into the equation of the ellipse, gives

$ k_i = \dfrac{1}{\sqrt{ \mathbf{n}_i (a^2 P_1 + b^2 P_2) \mathbf{n}_i } }$

so that

$ \mathbf{r_i - C} = \dfrac{ P_0 \mathbf{n_i}}{ \sqrt{ \mathbf{n}_i (a^2 P_1 + b^2 P_2) \mathbf{n}_i }} $

Pre-multiplying this with $\mathbf{n}_i^T $ gives

$ \mathbf{n_i}^T (\mathbf{r_i - C}) = \sqrt{ \mathbf{n}_i (a^2 P_1 + b^2 P_2) \mathbf{n}_i } $

Now,

$\mathbf{n_i}^T (\mathbf{r_i - C}) = \mathbf{n_i}^T (\mathbf{r_i - p_i + p_i - C}) = \mathbf{n_i}^T (\mathbf{p_i - C} ) $, because $\mathbf{n_i}^T (\mathbf{r_i - p_i} ) = 0 $

Consequently, we now have the following equations

$ \mathbf{n_i}^T (\mathbf{p_i - C} ) = \sqrt{ \mathbf{n}_i^T (a^2 P_1 + b^2 P_2) \mathbf{n}_i } = \sqrt{ a^2 \mathbf{n}_i^T P_1 \mathbf{n}_i + b^2 \mathbf{n}_i^T P_2 \mathbf{n}_i } , i = 1, 2, 3, 4$

Squaring and re-arranging, we get

$ a^2 \mathbf{n}_i^T P_1 \mathbf{n}_i + b^2 \mathbf{n}_i^T P_2 \mathbf{n}_i = \left( \mathbf{n_i}^T (\mathbf{p_i - C} ) \right)^2 , i = 1,2,3,4 $

This reduces to,

$ a^2 \mathbf{n}_i^T P_1 \mathbf{n}_i + b^2 \mathbf{n}_i^T P_2 \mathbf{n}_i = \alpha_i^2 - 2 \alpha_i \mathbf{n}_i \mathbf{C} + C^T \mathbf{n}_i \mathbf{n}_i^T C , i = 1,2,3,4 $

where $\alpha_i = \mathbf{p}_i^T \mathbf{n}_i $

Let

$\mathbf{V}_1 = \begin{bmatrix} \mathbf{n}_1^T P_1 \mathbf{n}_1 \\ \mathbf{n}_2^T P_1 \mathbf{n}_2 \\ \mathbf{n}_3^T P_1 \mathbf{n}_3 \\ \mathbf{n}_4^T P_1 \mathbf{n}_4 \end{bmatrix} $

and

$\mathbf{V}_2 = \begin{bmatrix} \mathbf{n}_1^T P_2 \mathbf{n}_1 \\ \mathbf{n}_2^T P_2 \mathbf{n}_2 \\ \mathbf{n}_3^T P_2 \mathbf{n}_3 \\ \mathbf{n}_4^T P_2 \mathbf{n}_4 \end{bmatrix} $

Now, let $\mathbf{W}_1$ and $\mathbf{W}_2$ be two linearly independent vectors that are orthogonal to $\mathbf{V}_1$ and $\mathbf{V}_2$, then pre-multiplying the system of equations above by $\mathbf{W}_1^T $ and $\mathbf{W}_2^T$, we eliminate $a^2 $ and $b^2$, and we end up with a $2 \times 2$ quadratic system in the two coordinates of $\mathbf{C}$.

The effect of pre-multiplying by $\mathbf{W}_1^T$ on the left hand side of $(*)$, is to reduce it to zero (annihilate it), because $\mathbf{W}_1 $ is orthogonal to $\mathbf{V_1} $ and $\mathbf{V_2} $.

Pre-multiplying the right hand side by $\mathbf{W}_1^T$ we will result in

$ 0 = \displaystyle \sum_{i=1}^4 \alpha_i^2 W_{1i} - 2 \mathbf{C}^T \left( \sum_{i=1}^4 \alpha_i W_{1i} \mathbf{n}_i \right) + \mathbf{C}^T \left( \sum_{i=1}^4 W_{1i} \mathbf{n}_i \mathbf{n}_i^T \right) \mathbf{C} $

And with $\mathbf{W}_2$ we get a similar equation:

$ 0 = \displaystyle \sum_{i=1}^4 \alpha_i^2 W_{2i} - 2 \mathbf{C}^T \left( \sum_{i=1}^4 \alpha_i W_{2i} \mathbf{n}_i \right) + \mathbf{C}^T \left( \sum_{i=1}^4 W_{2i} \mathbf{n}_i \mathbf{n}_i^T \right) \mathbf{C} $

These two equations can be solved for $\mathbf{C}$.

Substituting back into two of the equations gives $a^2 $ and $b^2 $.

This completes the specification of the ellipse.

I've tested the above procedure for the convex quadrilateral with vertices $\mathbf{p1} = (2,3) , \mathbf{p_2} = (12,9), \mathbf{p_3} = (5,17), \mathbf{p_4} = (0, 12) $ And an angle of inclination of the major or minor axis of $60^\circ$. The figure below shows the resulting ellipse, which validates the method outlined above.

As another example, I took $\mathbf{p1} = (2,3) , \mathbf{p_2} = (12,9), \mathbf{p_3} = (14,17), \mathbf{p_4} = (4, 11) $ And an angle of inclination of the major or minor axis of $45^\circ$

enter image description here

enter image description here

Hosam Hajeer
  • 21,978

0 Answers0