Maltab之求两条直线相交的锐角

function theta=getAcuteAngleOfTwoLines(point1,point2,point3,point4)
[x1,y1]=deal(point1(1),point1(2));
[x2,y2]=deal(point2(1),point2(2));
[x3,y3]=deal(point3(1),point3(2));
[x4,y4]=deal(point4(1),point4(2));
t =[x2-x1,y2-y1];
s =[x4-x3,y4-y3];
theta=acosd(dot(t,s)/(norm(t)*norm(s)));
if theta>180
    theta=180-theta;
end
end

line1:[point1,point2]
line2:[point3,point4]

上一篇:Reddit进行测试,允许用户像Twitter那样将任何NFT设为个人资料图片


下一篇:波场TRON入选PANews 2021“年度最*Web 3.0应用”榜单