quiver3 not plotting the end point
42 ビュー (過去 30 日間)
古いコメントを表示
I used the quiver3 function and was specting a vector that goes from 0,2,4 to 2,7,10. To confirm this I plotted both points but only the point 0,2,4 matches the origin of the vector, the point 2,7,10 doesn't quite match with the end of the vector. Can someone help me with this problem? Is it just a matter of positioning or what am I doing wrong?
Thanks in advance (and well sorry I kind of plotted 2 vectors the second one being from 0,2,4 to 2,4,6)
This is my code
quiver3(0,2,4,2,5,6)
axis([-10 10 -10 10 -10 10])
hold on
plot3(0,2,4,'+')
plot3(0+2,2+5,4+6,'+')
quiver3(0,2,4,2,2,2)
plot3(2,4,6,'+')
And this is the corresponding output
0 件のコメント
採用された回答
KALYAN ACHARJYA
2020 年 8 月 16 日
編集済み: KALYAN ACHARJYA
2020 年 8 月 16 日
I dont find any issue, please dont mixed up with the quiver and plot3, see your example
quiver3(0,2,4,2,5,7);
hold on;
quiver3(0,2,4,2,2,2);
axis([-10 10 -10 10 -10 10])
In both quiver plot case, draw the vecor with the components at given points. here first three digit represents the one co-ordinates (Draw the vector here), as plot is 3-D, hence you have to defined the three points (x,y,z), 2nd part with vector components. See First co-ordinates are same for both case, as it the co-ordinates for vecor origion, hence it starting the same points (initial points)
Same code
quiver3(x1,y1,z1,x2,y2,z2);
Now plot vector with components x2,y2,z2 at x1,y1,z1
Hope I get your question, if not let me know please!
3 件のコメント
KALYAN ACHARJYA
2020 年 8 月 16 日
編集済み: KALYAN ACHARJYA
2020 年 8 月 16 日
In the code having 3 plots:
Concept: quiver3(x,y,z,u,v,w) plots vectors with components (u,v,w) at the points (x,y,z)
First One:
quiver3(0,2,4,2,5,6)
Here in the figure vector with the components (2,5,6) at the point (0,2,4), which is reflectedin the figure
2nd Plot, Just a point (0,2,4) in 3d space, which is reflected, I have change the color for better visualizations
plot3(0,2,4,'ro','linewidth',2);
3rd Plot, Just an another point (2,7,10) in 3d space, which is reflected, I have change the color for better visualizations
plot3(2,7,10,'b*','linewidth',2);
And please note that the quiver start point and 2nd point having same co-ordinates, which is same reflected in the figure.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Vector Fields についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!