我在计算相同起点的2个向量之间的角度时遇到了一些问题-意味着有3个坐标
我曾尝试定义此函数,但当给出超过1个向量时,它不起作用:
def AngleBtw2Points(pointA, pointB):
ang1 = np.arctan2(*pointA[::-1])
ang2 = np.arctan2(*pointB[::-1])
return np.rad2deg((ang1 - ang2) % (2 * np.pi))
picture with example of the issue
输入是(X0,Y0)(X1,Y1)(X2,Y2)
Tags:
这解决了我的问题,谢谢你的帮助:)
如注释中所述,可以很容易地使用点积来获得两个向量之间的角度
相关问题 更多 >
编程相关推荐