how to find cosine angle known the end points of 2 linesegments
Ältere Kommentare anzeigen
There are 2 line segments, known their end points, how can i find angle between them
1 Kommentar
Guillaume
am 29 Apr. 2015
Akzeptierte Antwort
Weitere Antworten (1)
Roger Stafford
am 29 Apr. 2015
Bearbeitet: Roger Stafford
am 29 Apr. 2015
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
1 Kommentar
krishnasri
am 5 Mai 2015
Kategorien
Mehr zu Simulink finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!