필터 지우기
필터 지우기

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

조회 수: 30 (최근 30일)
Amin Ataei
Amin Ataei 2020년 12월 18일
편집: David Goodmanson 2020년 12월 19일
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