compute the unit vector given the angle
22 ビュー (過去 30 日間)
古いコメントを表示
Hi guys,
How to compute the unit vector given the direction? Is there any function in matlab to do this task.
Thanks
0 件のコメント
回答 (3 件)
Walter Roberson
2012 年 5 月 4 日
編集済み: Walter Roberson
2018 年 12 月 10 日
For angle theta in radians,
%[x, y] = pol2cart(1, theta); %-> incorrect
[x, y] = pol2cart(theta, 1); %repaired
3 件のコメント
Kye Taylor
2012 年 5 月 4 日
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
2016 年 1 月 9 日
If vector 'v' points in the desired direction, then do this to make it a unit vector:
v = v/norm(v);
0 件のコメント
Kye Taylor
2012 年 5 月 4 日
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)]
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!