1
votes

I have 2 lines with coordinates A(x1,y1; x2,y2) and B (x3,y3; x4,y4). Can I find the angle between them using MatLab.

enter image description here

1
Do you want to use some kind of graphical interface? Or do you just want to solve it by programming in the math?GameOfThrows
just solve... I have 30 like this figures in one plate. I want to calculate each of them. i have matrix with values of x1,x2..y3,y4.Dntk

1 Answers

3
votes

I guess if you are just looking for the code, something like this should do?

v1=[x2,y2]-[x1,y1];
v2=[x4,y4]-[x3,y3];
angle=acos(sum(v1.*v2)/(norm(v1)*norm(v2)));