compute the unit vector given the angle
17 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi guys,
How to compute the unit vector given the direction? Is there any function in matlab to do this task.
Thanks
0 Commenti
Risposte (3)
Walter Roberson
il 4 Mag 2012
Modificato: Walter Roberson
il 10 Dic 2018
For angle theta in radians,
%[x, y] = pol2cart(1, theta); %-> incorrect
[x, y] = pol2cart(theta, 1); %repaired
3 Commenti
Kye Taylor
il 4 Mag 2012
It's unusual that the inputs to the function don't match the "r-theta" convention that is used so often to identify the coordinate space.
Roger Stafford
il 9 Gen 2016
If vector 'v' points in the desired direction, then do this to make it a unit vector:
v = v/norm(v);
0 Commenti
Kye Taylor
il 4 Mag 2012
Given the angle
theta
in radians (counter-clockwise is positive theta, theta = 0 points in the positive x-direction) your unit vector is
u = [cos(theta),sin(theta)]
1 Commento
Vedere anche
Categorie
Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!