First of all I know that finding whether two ellipsoids intersect is complicated and there are specific algorithms created for this purpose (see, for instance, [1]. Actually, I am trying to follow this documentation in order to implement something in Mathematica. Of course there are other approaches).
I have "googled" for a while, searching for Mathematica codes but I could not find anything relevant.
Maybe this has to do with the fact that functions like RegionIntersection were introduced rather recently (2014; version 10.0).
Anyway, here is a simple code. It's not panacea of course. (Found here)
RegionIntersectQ[e1_, e2_] :=
RegionQ[DiscretizeRegion[RegionIntersection[e1, e2]] // Quiet]
It works in many cases. E.g.
Graphics3D[{g1 =
Ellipsoid[{0, 0, 0}, {{5, 2, 3}, {2, 3, 2}, {3, 2, 5}}],
g2 = Ellipsoid[{1, 1, 1}, {{10, 2, 3}, {2, 3, 2}, {3, 2, 5}}]},
Axes -> True]
RegionIntersectQ[g1, g2] // Timing
(*2.62...,True*)
My first question is about the time efficiency. Why 2.6 sec are needed?
We can find (in version 10.3 at least!) other cases that the code finds correctly whether the two ellipsoids intersect (the code tries harder when there is a tiny region of intersection).
But there are cases where it fails strangely and I do not understand why.
Graphics3D[{{Opacity[0.6],
g1 = Ellipsoid[{0, 0, 0}, {{5, 2, 3}, {2, 3, 2}, {3, 2, 5}}]},
g2 = Ellipsoid[{4.4, 1, 1}, {{10, 2, 3}, {2, 3, 2}, {3, 2, 7}}]},
Axes -> True]
RegionIntersectQ[g1, g2] // Timing
I am not expecting other people to spend their time to implement algorithms of others but I am wondering how we can use efficient the current functionality of Mathematica (built-in functions like RegionIntersection) to check if two ellipsoids intersect or not.
EDIT After writing the question I found this which has connection with my previous question here. @JasonB addresses the issue very thoroughly.
But the query remains the same: Can I expect Mathematica's relevant functionality to do the job (even with a bit help of us) or should I forget the whole idea?


Ellipsoidseems less complicated thanDelaunayMesh[RandomReal[1, {20, 3}]]:-)! – Dimitris Dec 04 '15 at 09:22RegionIntersection, but the reason for the timing problem is definitelyDiscretizeRegion, evaluate:First /@ {step1 = RegionIntersection[g1, g2]; // AbsoluteTiming, step2 = DiscretizeRegion[step1]; // AbsoluteTiming, step3 = RegionQ[step2]; // AbsoluteTiming}– Jason B. Dec 04 '15 at 10:12