How to place a cone along a line?

3 ビュー (過去 30 日間)
Leo Müller
Leo Müller 2016 年 3 月 27 日
コメント済み: Leo Müller 2016 年 3 月 28 日
Hello,
I have the following question:
How do I place a cone along a line or two points?
I know how to generate a cone:
cylinder([1 0])
But how do I move it where I want it to be?
Thank you!

回答 (2 件)

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 3 月 27 日
% get the coordinate x, y and z
[x,y,z]=cylinder([0 1])
% New coordinate
x=x+2
y=y+10
z=z+5
%----new cone----------
mesh(x,y,z)
  3 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2016 年 3 月 27 日
what line?
Leo Müller
Leo Müller 2016 年 3 月 27 日
I would like to create an arrow by giving two points and a color.

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


Star Strider
Star Strider 2016 年 3 月 27 日
If you want to plot cone-shaped arrowheads in 3D, use the coneplot function.
  3 件のコメント
Star Strider
Star Strider 2016 年 3 月 27 日
Unfortunately, no. The coneplot function is set up for volume data, so if you only want a quiver3 plot with cone-shaped arrowheads, I would settle for the regular quiver3 plot instead. I have no experience with converting quiver3 plot data to volume data to use with coneplot, and it has defeated my attempts to do so just now.
Leo Müller
Leo Müller 2016 年 3 月 28 日
Is there maybe a way to rotate a cylinder so that it will be aligned along two points?

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

カテゴリ

Help Center および File ExchangeLighting, Transparency, and Shading についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by