获得地平线上线的角度 [英] get angle of a line from horizon
本文介绍了获得地平线上线的角度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道如何从水平轴十,其他问题的A-B的角度所以做这两只之间的线。 。我知道我可以一直画二线交流和计算,但我不知道是否有一个更快的方法
I want to know how to get an angle of a line A-B from horizontal axis X. Other questions in SO do that only between two lines. I'm aware I can always draw second line A-C and calculate but I'm wondering if there's a faster method.
编辑:我很肯定我不是做一个不成熟的优化。
I'm very sure I'm not doing a premature optimization.
推荐答案
您可以使用反正切
为。
angle = atan((By-Ay)/(Bx-Ax))
这篇关于获得地平线上线的角度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文