Algorithm to determine if a 3D ellipsoid is

Jeffrey Ali

Jeffrey Ali

Answered question

2022-03-15

Algorithm to determine if a 3D ellipsoid is contained within another?
Can anyone point me to an algorithm for how to efficiently check if a 3D ellipsoid is contained within another one? We can assume their origins are collocated.
I am dealing with covariance ellipsoids constructed from matrices.

Answer & Explanation

Veronica Riddle

Veronica Riddle

Beginner2022-03-16Added 9 answers

Since the two ellipsoid share the same center, then we can take this center to be the origin of the coordinate system, and then the equations of the two ellipsoids will be
rTQ1r=1 and rTQ2r=1
Diagonalizing Q1 so that Q1=R1D1R1T, then
rTR1D1R1Tr=1
Define u=D1(12)R1Tr as a change of variable, then uTu=1 so that the first ellipsoid is transformed into the unit sphere. Applying the same transformation to the second ellipsoid, we get
uTD1(12)R1TQ2R1D1(12)u=1
which is of the form uTQ2u=1 with
Q2=D1(12)R1TQ2R1D1(12)
Now diagonalize Q2 into Q2=RDRT
Finally compute the diagonal matrix D =D(12)
The diagonal entries of D'' are the lengths of the semi-axes of the second ellipsoid after transformation.
If the maximum of the diagonal entries of D'' is less than 1 then the second ellipsoid is totally inside the first ellipsoid. If the minimum of the diagonal entries of D'' is greater than 1 then the second ellipsoid totally contains the first ellipsoid. Otherwise, the two ellipsoids intersect.

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?