how to find cosine angle known the end points of 2 linesegments
古いコメントを表示
There are 2 line segments, known their end points, how can i find angle between them
1 件のコメント
Guillaume
2015 年 4 月 29 日
採用された回答
その他の回答 (1 件)
Roger Stafford
2015 年 4 月 29 日
編集済み: Roger Stafford
2015 年 4 月 29 日
Using 'atan2' or 'atan2d' and cross product is more accurate for angles that are near zero or near pi (180 degrees.)
a = atan2(norm(cross(D1,D2)),dot(D1,D2)); % Angle in radians
or
a = atan2d(norm(cross(D1,D2)),dot(D1,D2)); % Angle in degrees
カテゴリ
ヘルプ センター および File Exchange で Function Creation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!