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에서 Simulink에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!