How can i measure Angle in 3-D?

4 ビュー (過去 30 日間)
Mahmoud Sami
Mahmoud Sami 2018 年 9 月 8 日
コメント済み: Mahmoud Sami 2018 年 9 月 22 日
I have points
S =[0.5360 0.8850 2.3962;
0.5360 0.8850 2.4291;
0.5436 0.1708 1.8550;
0.7532 0.8089 0.9649;
0.9630 0.4010 1.1216]
plot3(S(:, 1), S(:, 2), S(:, 3), 'b.', 'MarkerSize', 30, 'LineWidth', 2);
grid on;
These points are connected to make connected lines. How can I measure the angle between the lines?
  2 件のコメント
Mahmoud Sami
Mahmoud Sami 2018 年 9 月 8 日
The 1st line connected between the first point and the second one, the second line connected between the second point and the third one, to the end of S. The angle the 1st line and 2nd line. Then 2nd line and 3 rd line.

サインインしてコメントする。

採用された回答

Jim Riggs
Jim Riggs 2018 年 9 月 9 日
編集済み: Jim Riggs 2018 年 9 月 9 日
The link in the answer by Aquatris is not working for me.
The angle between any two lines is given by the dot product.
Define each line segment as a vector from one point to the next in the point sequence, i.e. segment D1 = P2 - P1 = {P2x-P1x, P2y-P1y, P2z-P1z}. Likewise, define segment D2 as P3 - P2 = {P3x-P2x, P3y-P2y, P3z-P2z}. Now normalize these two vectors to make then unit vectors U1 = D1/|D1| and U2 = D2/|D2|.
Take the dot product of U1 and U2; this is the cosine of the angle between line segment 1 and 2.
  4 件のコメント
Mahmoud Sami
Mahmoud Sami 2018 年 9 月 22 日
Thanks for your answer. Sorry for late feedback.

サインインしてコメントする。

その他の回答 (1 件)

Aquatris
Aquatris 2018 年 9 月 9 日
Check out this link which has the answer.
  1 件のコメント
Mahmoud Sami
Mahmoud Sami 2018 年 9 月 11 日
Thanks for your answer. I ask for Matlab coding for that.

サインインしてコメントする。

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by