Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

How to calculate the angle between two lines (an urgent help needed)

2 vues (au cours des 30 derniers jours)
Fahad
Fahad le 11 Oct 2012
Does anyone have any idea how to calculate two lines between four points. For example Line1= [x1,y1], [x2,y2] and Line2= [x3,y3], [x4,y4]. Then calculating the angle between these two lines.
I have found codes but they didn't work with me.
Thanks,
Fahad

Réponses (1)

Azzi Abdelmalek
Azzi Abdelmalek le 11 Oct 2012
Modifié(e) : Azzi Abdelmalek le 11 Oct 2012
x1=2 ;y1=4;x2=3;y2=10
x3=1;y3=5;x4=6;y4=20
v1=(x2-x1)+j*(y2-y1)
v2=(x4-x3)+j*(y4-y3)
teta=angle(v2)-angle(v1)

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by