Plotting a 3d cone

50 ビュー (過去 30 日間)
Animesh Srivastava
Animesh Srivastava 2021 年 4 月 20 日
編集済み: Matt J 2021 年 4 月 20 日
Hi,
I am trying to plot a 3d cone. I have the following details about it.
  1. The coordinates of the vertex.
  2. the height of the cone and the axis of the cone (the axis is not predefined as x,y,z axis. i have a separate line along which i have to plot the cone).
  3. The angle at the vertex from the axis. (that is the value of theta and not 2 times theta.
i am trying a lot, but unable to do so. the general cone generators like 'cylinder([0 1])' are not usable for me.
Can anyone give any suggestions ot tips regarding the same?

採用された回答

Matt J
Matt J 2021 年 4 月 20 日
編集済み: Matt J 2021 年 4 月 20 日
the general cone generators like 'cylinder([0 1])' are not usable for me.
I think they are. You just have to reposition the cone with an hgtransform.
[X,Y,Z]=cylinder([0 1],1000);
axis([-3 +3,-3 +3,-3 +3])
M=makehgtform('translate',[-1,-1,-1],'xrotate',pi/4,'yrotate',pi/4);
h=surf(X,Y,Z,'Parent',hgtransform('Matrix',M),'LineStyle','none','FaceAlpha',0.3);
view([-75,35])
axis vis3d
grid on

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by