Calculate angles between two intersecting lines using the slopes if one slope is infinite
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
For example m1=√3/2 & m2 = infinity
0 commentaires
Réponses (1)
Star Strider
le 6 Mar 2016
An infinite slope is a vertical line, so this is straightforward:
m1 = sqrt(3/2);
thr = pi/2 - atan2(m1, 1);
thd = thr * 180/pi;
figure(1)
plot([0 0], [0 1.5])
hold on
plot([0 1], [0, m1])
hold off
grid
axis([-0.1 1 -0.1 1.5])
axis equal
text(0.35, 1, sprintf('\\leftarrow \\theta = %.2f\\circ \\rightarrow', thd), 'Rotation',-thd, 'HorizontalAlignment','center')
0 commentaires
Voir également
Catégories
En savoir plus sur Annotations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!