Use vrrotvec to calculate the rotation angles between two vectors (R2015b)
Afficher commentaires plus anciens
I need to calculate the rotation angle to transform vector a = [1, 0, 0]' to b = [1/sqrt(3), 1/sqrt(3), 1/sqrt(3)]',such that I script below:
X = [1, 0, 0]';
Y = [1/sqrt(3), 1/sqrt(3), 1/sqrt(3)]';
R = vrrotvec(X, Y);
As the outcome, I have R = 0, -0.7071, 0.7071, 0.9553
What is the meaning of the first three items, i.e. 0, -0.7071 and 0.7071? Are they the cosine value of the rotation angle against x-, y- and z-axes?
5 commentaires
Image Analyst
le 21 Oct 2016
vrrotvec() is not in base MATLAB, nor any of my toolboxes. It's hard to answer your question without seeing the course code of vrrotvec(). You can post it if you want an answer.
Kerry Schutz
le 21 Oct 2016
For ImageAnalyst: vrrotvec is a function included with Simulink 3D Animation, an add-on product. It is not part of base MATLAB.
For Lu Gao: vrrotvec outputs a four element row vector. Per the doc on this function, the first 3 elements specify the rotation axis in 3-D and the last element is the angle of rotation (in radians). For the particular vectors used in your example, the first 3 elements would be computed as: cross(X,Y)/norm(cross(X,Y)) and the 4th element of the row vector is computed as: acos(dot(X,Y))
Image Analyst
le 21 Oct 2016
Thanks, Kerry. I've added it to the list of products below.
Mritula C
le 16 Jan 2019
Wont there 3 rotation angles corresponding to 3 different planes?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Trigonometry dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!