Arbitrary ellipses means that they can be scaled, translated and rotated in any way in 2D. Do you know some high-school method (might be slightly more advanced than that) to find the minimum distance? I'd love a symbolic expression/solution but a numerical solution for a specific pair of ellipses would be greatly appreciated too.Thanks very much for any solution.
-
possible duplicate of minimum distance between two ellipses – joriki Sep 12 '12 at 13:38
1 Answers
In general, an ellipse is given by $$G(x,y)=a x^2 + b y^2 + c x y + d x + e y + f =0.$$
Let us denote the two ellipses with the subscripts 1 and 2. As we would like to minimize the square distance $d^2=(x_1 - x_2)^2 + (y_1 + y_2)^2$ between the two ellipses. We use the method of Lagrange multiplier and write $G = d^2 + \lambda_1 G_1(x_1,y_1) + \lambda_2 G_2(x_2,y_2)$ with the conditions for an extremum $$ \partial_{x_1} G = 2 (x_1 - x_2) + λ_1(2 a_1 x_1+ c_1 y_1 +d_1) =0,$$ $$\partial_{y_1} G =2 (y_1 - y_2) + λ_2(2 b_1 y_1+ c_1 x_1 +e_1) =0,$$ $$ \partial_{x_2} G = 2 (x_2 - x_1) + λ_1(2 a_2 x_2+ c_2 y_2 +d_2) =0,$$ and $$\partial_{y_2} G =2 (y_2 - y_1) + λ_2(2 b_2 y_2+ c_2 x_2 +e_2) =0.$$ Together with the conditions $G_1 = G_2 =0$, we have 6 equations for 6 unknowns (though some are not linear but quadratic). We can "easily" solve for $x_1,y_1,x_2,y_2,\lambda_1,\lambda_2$. Plugging the different solutions into the expression for $d^2$, we can select the one that minimizes the distance.

- 23,360
-
Do you think you could show me how to solve for x1,y1,x2,y2,λ1,λ2? Because essentially I got up to this stage every time and got stuck and couldn't proceed. It might be easy as you say but I just can't come to the solution. – David Hoffman Sep 10 '12 at 19:29
-
1
-
Yes, that's certainly what he meant. He just made a little mistake. – David Hoffman Sep 10 '12 at 19:34
-
So basically, what I have to do now is to express one variable in the terms of the others, and gradually decrease the number of variables until i get the solution for one, and then plug it in for the others, right? – David Hoffman Sep 10 '12 at 19:49
-
In general, I think you'd end up solving a polynomial of degree $12$, so numerical methods will be needed. Certainly it's beyond what's usually considered as "high school". – Robert Israel Sep 10 '12 at 20:20
-
@Robert, there are only four solutions, at least when you look at the real picture. Do you “see” eight more complex ones? – Lubin Sep 10 '12 at 20:46
-
For example, for the ellipses $4(x-1)^2+(x-1)(y-2)+3(y-2)^2=1$ and $x^2+2 y^2-1$ the degree-12 polynomial for $x_1$ is $2108022192 x^{12}-65348687952 x^{11}+880220322778 x^{10}-6740154275472 x^9+32318892381076 x^8-101679285439864 x^7+216617479327266 x^6-318321551682684 x^5+323751615855267 x^4-224354648797988 x^3+101332784910938 x^2-26948700304592 x+3206600335499$. – Robert Israel Sep 10 '12 at 20:54
-
In some cases, though, you may get more real solutions, e.g. for $3 x^2+y^2+x y/10 +y=5$ and $x^2+2y^2=1$ there are 8. – Robert Israel Sep 10 '12 at 22:22
-
An alternative way of going about it would be to start from the condition that at an extremal point the tangents to the two ellipses must be perpendicular to the separation vector. Hmm. On second thought that is likely equivalent to the method of Lagrange multipliers. – Jyrki Lahtonen Sep 11 '12 at 11:52
-
Look guys I'm still in high school and it is pretty advanced though I take higher maths and all. Is this way beyond high-school-graduate level or just slightly? – David Hoffman Sep 11 '12 at 13:23
-
@DavidHoffman: if you know about derivatives then the method of Lagrange multiplier is not far off. There should be pretty good explanations in the web. Regarding the solution of a polynomial of degree 12: it is in general impossible to find the solutions explicitly so you always rely on numerical methods. – Fabian Sep 11 '12 at 13:27
-
Could I just ask one question? All of you are talking about some polynomial equation of 12 degree. BUT where is it? How did you get there, what did you do? – David Hoffman Sep 11 '12 at 13:30
-
@DavidHoffman: if you take the 6 equations above. And you start eliminating variables (let us say, you eliminate $\lambda_1$ and $\lambda_2$) then $x_2,y_2$ and finally $y_1$, you will end up with a polynomial for $x_1$ which has a higher order than the original polynomial. – Fabian Sep 11 '12 at 15:18
-
I know I'm probably asking too much but is here anyone willing to send me a .jpg or .pdf of that solution? I don't know what I'm doing wrong but I just can't figure it out. – David Hoffman Sep 12 '12 at 13:01