Effacer les filtres
Effacer les filtres

how to check if a point is inside an rotated ellipsoid?

29 vues (au cours des 30 derniers jours)
Amin Ataei
Amin Ataei le 18 Déc 2020
i made a ellipsoid with this function [X,Y,Z] = ellipsoid(xc,yc,zc,xr,yr,zr) and with function (rotate) i rotated with certain angel.
after rotation the ellipsoid , how can we check if a given point with its coordinante(x,y,z) is inside of ellipsoid.
If ellipsoid is oriented in main axes (not rotated) we can use the equation from ellipsoid also :
(x/a)2 + (y/b)2 + (z/c)2 < 1 point is inside ellipsoid
(x/a)2 + (y/b)2 + (z/c)2 > 1 point is not inside ellipsoid
but how can we check if the point is inside when ellipsoid is rotated? in this case are all point of ellipsoid rotated and we can not use upper equation anymore , right?

Réponse acceptée

David Goodmanson
David Goodmanson le 19 Déc 2020
Modifié(e) : David Goodmanson le 19 Déc 2020
Hi Amin,
Since it appears that you know the rotation matrix, you can rotate the point p in question in the opposite direction to how you rotated the ellipsoid, keeping in mind that you have to rotate about the same rotation axis as before. For point p, the coordinates (x,y,z) --> (x1,y1,z1). Then use the new coordinates in the equations that you show above. Except that the ellipse is centered at xc,yc,zc so correct equation is actually
(x-xc)^2 (y-yc)^2 (z-zc)^2
-------- + -------- + -------- <1 inside or >1 outside
xr^2 yr^2 zr^2

Plus de réponses (0)

Catégories

En savoir plus sur Computational Geometry dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by