How to calculate a angle between two vectors in 3D
古いコメントを表示
Hi, I have a question, I have a table with 12 reference points
if true
% POINT X Y Z
1 0 0 0
2 70.5 0 0
3 141 0 0
4 141 0 141.5
5 70.5 0 141.5
6 0 0 141.5
7 0 137.5 0
8 70.5 137.5 0
9 141 140 0
10 141 141.5 141.5
11 70.5 139 141.5
12 0 141.5 141.5
end
The segment 1 is defined by the point 1 and point 2 and the segment 2 is defined by the point 1 and point 7. I am able to calculate the angle with the following rotine,
if true
% angle_x1_x13 = atan2(norm(cross(v1,v2)),dot(v1,v2));
anglout = radtodeg(angle_x1_x13);
end
The result is ~90º and this result is correct if I think in xy plan, but I need to calculate the angle to yz plan and xz plan. Anyone help me?
2 件のコメント
sixwwwwww
2013 年 10 月 18 日
What is v1 and v2 here in your code?
Paulo Oliveira
2013 年 10 月 18 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Graphics Object Properties についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!