ellipsoids intersection volume- how to speed up the code ?

2 ビュー (過去 30 日間)
Sakshi
Sakshi 2011 年 6 月 22 日
I have to determine the intersection volume occupied by ellipsoid in 3D space vs the volume occupied by another ellipsoid at a different orientation. I have created bounding boxes around the ellipsoids for this purpose. However, the usage of below commands makes the code slow.
[x y z]= ellispoid(xc,yc,zc,xr,yr,zr,n)
h=surf(x,y,z)
Any suggestions on how to make the code faster. I dont need the graphical visualisation of the ellipsoidal intersection, so can that be somehow eliminated to make code faster ?

採用された回答

Patrick Kalita
Patrick Kalita 2011 年 6 月 22 日
If you don't want to view the ellipsoid, then simply take out the call to surf.
  3 件のコメント
Patrick Kalita
Patrick Kalita 2011 年 6 月 22 日
I see. Your question didn't mention anything about such a restriction. In the future, you might want to include relevant information like that in your question.
Why don't you just do the rotation yourself? You can define an appropriate rotation matrix (http://en.wikipedia.org/wiki/Rotation_matrix#Rotations_in_three_dimensions), then multiply each (x,y,z) coordinate of the ellipsoid by the rotation matrix to obtain the coordinates of the rotated ellipsoid.
Sakshi
Sakshi 2011 年 6 月 22 日
I am sorry for not clearly mentioning ths rotation aspect in the question. Thanks a lot,the suggestion given by you has reduced the time to a big extent from 70 seconds to 3 seconds. !

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by