Determining if ellipse is fully inside another ellipse

277 Views Asked by At

I have two ellipses which are both not rotated, but have different sizes. I want to know if the smaller ellipse 1 is fully inside the larger ellipse 0. In my special case both ellipses have the same axis ratio, so $a_0/b_0=a_1/b_1$, but I doubt this makes a difference for the calculation.

enter image description here

I have started to work on a solution, but I am not so sure if this is the right approach and if it will ultimately lead to success. Here is what I have come up with so far:

The radius of ellipse 0 can be calculated for any point on the ellipse as

$$ r_0=\sqrt{(x-x_0)^2+(y-y_0)^2} $$ The general equation for an ellipse gives a relation between $x$ and $y$ for points on the ellipse.

$$ \frac{(x-x_0)^2}{a^2}+\frac{(y-y_0)^2}{b^2}=1 $$

$$ (y-y_0)^2=b*\sqrt{1-\frac{(x-x_0)^2}{a^2}} $$

This can be used to calculate radius of both ellipses depending on the x coordinate.

$$ r_0 = \sqrt{(x-x_0) + b_0^2(1-\frac{(x-x_0)^2}{a_0^2})} $$

$$ r_1 = \sqrt{(x-x_1) + b_1^2(1-\frac{(x-x_1)^2}{a_1^2})} $$

To calculate the distance $s$ between both ellipses at a certain $x$ coordinate, we simply have to add the distance $d_{01}$ between the center points to radius 1 and subtract this from radius 0.

$$ s=r0 - (d_{01} + r1) $$ where $$ d_{01} = \sqrt{(x_1-x_0)^2 + (y1-x_0)^2} $$

Now I have an equation where $s$ only depends on $x$. My idea is to get the minimum of $s$ through the first derivative. If the minimum is non-negative, ellipse 1 is inside or on ellipse 0. If it is negative, part of ellipse 1 is outside ellipse 0.

Here are my questions:

  1. Am I on the right way so far?
  2. Is calculating the minimum for s the right approach?
  3. Do I have a chance to actually calculate the minimum of $s$?

Note: Ther is a similar question here, but I think my case is much simpler because the ellipses are not rotated similar.

1

There are 1 best solutions below

4
On BEST ANSWER

Because they have the same axis ratio and are orientated the same, the easy solution is to multiply all y-coordinates by $\frac{a}{b}$. Then you have two circles.

All points on the large circle are within $a_0$ of its centre whereas all points on the small circle are within $a_l+\sqrt{(x_l-x_0)^2+\frac{a^2}{b^2}(y_l-y_0)^2}$.