问题:
In a programming language (Python, C#, etc) I need to determine how to calculate the angle between a line and the horizontal axis?在编程语言(Python、C# 等)中,我需要确定如何计算直线与水平轴之间的角度?
I think an image describes best what I want:我认为一张图片最能描述我想要的东西:
Given (P1 x ,P1 y ) and (P2 x ,P2 y ) what is the best way to calculate this angle?给定 (P1 x ,P1 y ) 和 (P2 x ,P2 y ) 计算这个角度的最佳方法是什么? The origin is in the topleft and only the positive quadrant is used.原点位于左上角,仅使用正象限。
解决方案:
参考一: https://stackoom.com/question/VpTr参考二: How to calculate the angle between a line and the horizontal axis?