已知两个坐标点,计算两点的角度

def calc_angle(x1, y1, x2, y2):
  x = abs(x1 - x2)
  y = abs(y1 - y2)
  z = math.sqrt(x * x + y * y)

  angle = round(math.asin(y / z) / math.pi * 180)
  return angle

https://bbs.csdn.net/topics/340120347

https://blog.csdn.net/crazy_scott/article/details/81781906

https://blog.csdn.net/JohinieLi/article/details/81041550

你可能感兴趣的:(python)