Unit vectors. How can I plot them?
32 ビュー (過去 30 日間)
古いコメントを表示
Dear all, I need to plot vectors given as a matrix of several row and three column. For each row I would like to plot an indipendent vector using three scalar (the cosin director).
Do you have any idea? Regards, MG
************************************************************************************************************************************
I wrote this: quiver3(zeros(3,1),zeros(3,1),zeros(3,1),[1;0;0],[0;1;0],[0;0;1]) in order to create a reference system XYZ. This is ok!!
Now I want to plot a line (a unit vector) over the refernce system...for example V=[0.22 0.51 -0.82]. I don't have any origin or any end pont... just the direction cosine. I got this vector V in this way: Using two 3D point (for example A and B) I get the vector v=A-B then the unit vector V= (A-B)/norm(A-B) So If I want to plot V, without A and B, but only using V... how can I do?
Thanks
[EDITED, Jan S, copied from answer section]:
3D plot. Just a simple line without arrows. I tried with quiver3 but in this function I can only insert point to point coordinates. But I just have the direction....
2 件のコメント
Jan
2012 年 4 月 28 日
Do you want a 2D or 3D plot? Do you want thin lines or thicker 3D lines, arrow heads or lines only? Please post more details.
BTW, please vote and accept answers, which helped you.
Jan
2012 年 4 月 29 日
Please add further explanations by adding to the original question, not by creating an answer.
回答 (2 件)
Jan
2012 年 4 月 29 日
quiver3(zeros(3,1),zeros(3,1),zeros(3,1),[1;0;0],[0;1;0],[0;0;1]);
hold('on');
quiver3(0,0,0,V(1),V(2),V(3), 'r');
0 件のコメント
Jan
2012 年 4 月 29 日
The direction of a unit vector is the end position of the vector, when you start from the origin. Please post, what you have tried with quiver3 and explain, which problems occurred.
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!