我有一个太阳能电池板指向某个方向(它是法向量)。我想计算它与太阳当前位置之间的角度。我正在使用 pyephem,我有两对方位角和高度的信息。
panel_az = ephem.degrees('180')
panel_alt = ephem.degrees('45')
sun_az = ephem.degrees('245')
sun_alt = ephem.degrees('22')
找到面板的法向量与指向太阳的向量之间的角度的最简单方法是什么?
最佳答案
该库提供了一个separation()
函数,可以给出两个球面坐标之间的角度;在快速引用的这一部分底部附近查看:
http://rhodesmill.org/pyephem/quick.html#other-functions
我想如果你运行,你会得到你正在寻找的角度:
a = ephem.separation((panel_az, panel_alt), (sun_az, sun_alt))
print a
祝你好运!
关于python - 两对方位角和高度之间的角度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18685275/