[英]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.