Do Axis-Aligned Ellipses Intersect?

Started by
11 comments, last by Daerax 19 years, 8 months ago
Unfortunately you can't just join their centres and see where this line crosses the ellipses. Obviously if it enters one ellipse before it leaves the other the ellipses overlap but the reverse is not generally true.

E.g. consider two ellipses, one tall and thin, one wide and short, with formulae

x^2 + 100y^2 = 1;
100(x - 1)^2 + (y - 1)^2 = 1;

These overlap as both pass through point (1, 0) but a quick sketch will convince you that the line joining their centres lies mostly outside both ellipses.

The only time the line joining the centres gives the correct answer is when the ellipses have the same shape, i.e. the ratio of the axes lengths is the same so they are geometrically similar. Then you can transform the problem to one containing two circles, where comparing the radii and distance between centres makes obivous sense.
John BlackburneProgrammer, The Pitbull Syndicate
Advertisement
You're right, I did not visual such a scenario, all the ellipses I imagined were similar in width. Kudos to you two for pointing that out.

<UNECESSARY tag = "side story">
As a way of excuse I'd like to state I was educated in the american school system (Maryland, Pennsylvania and New Jersey), why, I did not even take Geometry, we ate cake in Algebra, threw stuff out the window and tried to get the teacher to cry in Algebra 2 and discussed the events of our previous evenings in Calculus. Consequently, all of my mathematical knowledge is self-taught and is very specific (specifically those with required to understand engineering and physics principles, where things like fourier analysis, vector analysis, matrix algebra , ordinary and partial differatial equations are the most important). Its an ongoing task and requires constant practice (I can now solve Second Order Differential equations in my head... not as impressive as it might sound.).</UNNECESSARY>
Here is an image to go with what johnb states.



I'll try and see if I can think up another method that requires as little code as the one I used above yet works in all scenarios.

EDIT: I don't think there is a better method than either using the genaral method or solving for intersections..Perhaps something to do with comparing the areas of the triangle created by the line from the centres and the semi-minor axis of one of the ellipses? Well Im done here and apologize for being unable to provide you with a unique algorithim to take care of this task.

[Edited by - Daerax on August 22, 2004 9:30:12 PM]

This topic is closed to new replies.

Advertisement