Determing if a point is inside an ellipsoid

How can you determine if a given set of points is inside an off center rotated ellipsoid?

 채택된 답변

David Sanchez
David Sanchez 2013년 11월 25일

1 개 추천

the point (x,y,z) will be inside the ellipsoid when
(x-xo)^2/a + (y-yo)^2/b +(z-zo)^2/c < 1
it will be outside the ellipsoid when
(x-xo)^2/a + (y-yo)^2/b +(z-zo)^2/c > 1

댓글 수: 7

Omair
Omair 2013년 11월 25일
How do i take the rotation into account?
The equation in matrix form for a rotated ellipse is
x'*R'*diag(1./[a,b])*R*x<=1
where R is a rotation matrix.
Image Analyst
Image Analyst 2013년 11월 25일
Omair, I don't understand. You must have the ellipsoid equation already. If you don't then what is there to check your points against? If you just have points and no equation at all, then of course you can find any arbitrary huge ellipsoid that will contain them all, but that's not useful. I'm not sure why you asked about rotation.
Omair
Omair 2013년 11월 25일
I have training data set to which I am trying to fit an ellipsoid. This data is distributed along the x=y=z line in 3 dimensions. I know my rotation matrix and i know my center of the ellipsoid. I want to check the goodness of fit by varying different parameters of the ellipsoid. My evaluation criteria for the goodness of the fit is true positives and false positives. I need to find how many of my sample training points lie inside the ellipsoid and how many of my disturbance points lie inside the ellipsoid.
One thing i tried was to apply the inverse of the rotation matrix to my data points and then check if the points lie inside the ellipsoid or not using the above given equation. Does that make sense?
Image Analyst
Image Analyst 2013년 11월 25일
You might try the FAQ though that might be for fitting an ellipsoid shell rather than solid - I don't know. How did you discover your rotation matrix if you don't even have the equation of the ellipse yet??? How are you determining the angle and length of the axes of the ellipsoid? And if you have those, then you have the equation.
Omair
Omair 2013년 11월 26일
I know that my data is distributed along the x=y=z line in the [0,300] for all three variables. The rotation matrix i derived using this information.
Ilja Westra
Ilja Westra 2022년 10월 7일
If anybody else stumbles upon this and has trouble with the equation not working:
((x-xo)/a)^2 + ((y-yo)/b)^2 +((z-zo)/c)^2 < 1
Taking the whole fractions squared instead of just the distance from the point to the ellipsoid center worked for me.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Computational Geometry에 대해 자세히 알아보기

태그

질문:

2013년 11월 25일

댓글:

2022년 10월 7일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by