![](/img/trans.png)
[英]How do I find the slope (m) for a line given a point (x,y) on the line and the line's angle from the y axis in python?
[英]How to find rotation Angle, so two point's Y-axis is same
您可以使用带有点坐标的math.atan2
function 找到旋转角度。
angle = math.atan2(p2.y-p1.y, p2.x-p1,x)
请注意,围绕坐标原点的旋转也会移动第一个点,因此您可能需要围绕第一个点进行旋转。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.