5

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.

Waruyama
  • 217
  • 2
    Since your two ellipses are similar, you just have to determining whether the obvious centre of similarity is inside the large ellipse or outside it. – user10354138 Feb 19 '21 at 09:26
  • 2
    Since the ellipses are similar, you can scale the axes in such a way that both ellipses become circles. Once that’s done, the problem is easy. – bubba Feb 19 '21 at 09:35
  • If they were not similar, you’d end up trying to find the roots of a quartic equation (or, at least, studying the existence of its roots). – bubba Feb 19 '21 at 09:36

1 Answers1

4

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}$.

  • Thank you so much. I was not much looking forward to solving quartic equations. Also, my assumption in the first paragraph that assumption of similarity does not make a difference needs to be deleted. – Waruyama Feb 19 '21 at 09:30
  • Glad to be of help. P.S. If you are dealing with numerical examples it can also be sometimes useful to translate the circles so that one is centred on the origin. –  Feb 19 '21 at 09:35
  • But If the ratios $a_k/b_k$ are not the same, you don't have 2 circles... but a circle and an ellipse... – Jean Marie Feb 19 '21 at 09:47
  • @Jean Marie. Of course, but the OP says they are the same. –  Feb 19 '21 at 10:43