フィルターのクリア

Calculate angles between two intersecting lines using the slopes

13 ビュー (過去 30 日間)
hu
hu 2014 年 8 月 14 日
コメント済み: Amit Haldar 2016 年 1 月 6 日
Hi,
I have two slopes M1 and M2 that I wish to check the angle between them.
I was told that I can use the inverse tangent of (m1 - m2)/(1 + m1*m2)
atand((m1-m2)/(1-m1*m2))
Is it true, why? What is the difference if I use the (m1 - m2)/(1 - m1*m2) instead?
Thanks
  1 件のコメント
Amit Haldar
Amit Haldar 2016 年 1 月 6 日
Yes that is how we calculate the angle between two lines.

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

採用された回答

Roger Stafford
Roger Stafford 2014 年 8 月 14 日
That formula comes from the trigonometric identity
tan(A-B) = (tan(A)-tan(B))/(1+tan(A)*tan(B))
Note: You have the sign wrong in atand((m1-m2)/(1-m1*m2))
It should be understood that taking the arctangent (atand) of your expression corresponds to rotating the line with slope m2 in both a counterclockwise and a clockwise direction around the intersection point until first encountering the line with slope m1. Going counterclockwise counts as a positive angle and clockwise is considered negative. Therefore your answer will lie between +90 and -90.
  3 件のコメント
Roger Stafford
Roger Stafford 2014 年 8 月 14 日
編集済み: Roger Stafford 2014 年 8 月 14 日
Correction: If you take the absolute value of (m1-m2)/(1-m1*m2) it can still give a negative angle. If you take the absolute value of value from atand, it will give you the positive angle between the lines which does not exceed 90 degrees. Is the latter what you were asking?
hu
hu 2014 年 8 月 15 日
yep

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

その他の回答 (2 件)

Rick Rosson
Rick Rosson 2014 年 8 月 14 日
phi = atan(m1) - atan(m2);

Amir
Amir 2014 年 8 月 14 日
This image is from this video: https://www.youtube.com/watch?v=4bGt5wQf818
Hope this can clarify this for you.

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by