2つのベクトルがなす角度を求めるための方法が分からないのですが、どういった計算方法があるでしょうか?
130 views (last 30 days)
Show older comments
大腿、下腿の単位ベクトルx,y,zを作成したので、膝関節の屈曲/伸展角度を求めるために2つのベクトルがなす角度を求めたいのですが、atan2のコードの使い方がよくわかりません。どなたかわかる方がいらっしゃいましたらお願いいたします。
0 Comments
Accepted Answer
Atsushi Ueno
on 11 Aug 2021
atan2 は、直交座標系の座標(x, y)から極座標系の角度Θを求めるのに使われます。今回の様に2つのベクトルがなす角度を求めるには、内積から角度を求める方法を使うべきです。MATLABのacos関数、内積(ドット積)、ベクトルの大きさ(ノルム)を用いても演算出来ますが、2つのベクトルがなす角度を求める関数を用いれば最もシンプルに記述できます。
x1 = [0 1 0]; % 大腿の単位ベクトルx成分(y,z成分も可)
x2 = [1 0 0]; % 下腿の単位ベクトルx成分
theta = subspace(x1',x2') % 注:subspace関数には列ベクトルの形で入力する
% theta = 1.5708[rad] = pi/2[rad] = 90[deg]
10 Comments
More Answers (0)
See Also
Categories
Find more on Operating on Diagonal Matrices in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!