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

30 次查看(过去 30 天)
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?

采纳的回答

David Goodmanson
David Goodmanson 2020-12-19
编辑:David Goodmanson 2020-12-19
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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Computational Geometry 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by