Unit vectors. How can I plot them?
49 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Jan
le 28 Avr 2012
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
le 29 Avr 2012
Please add further explanations by adding to the original question, not by creating an answer.
Réponses (2)
Jan
le 29 Avr 2012
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 commentaires
Jan
le 29 Avr 2012
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 commentaires
Voir également
Catégories
En savoir plus sur Data Distribution Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!