本文介绍了如何从enu向量中获得方位角和仰角的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取一个enu矢量到另一个enu矢量的方位角和高程?

How do you get the azimuth and elevation from one enu vector to another enu vector?

链接到公式或代码段将很有帮助.搜索时我根本没有得到太多信息.

A link to a formula or piece of code would be helpful. I'm not getting much information at all when searching.

推荐答案

您可以计算East-North-Up矢量(x,y,z)之间的方位角和仰角(u,v,w)使用以下内容:

You can calculate the azimuth and elevation angles between East-North-Up vectors (x,y,z) and (u,v,w) using the following:

  1. 减去向量:(x,y,z)-(u,v,w)=(xu,yv,zw)=(x',y',z')
  2. 计算方位角: a = arctan(x'/y')= arctan((x-u)/(y-v))
  3. 计算仰角: e = arctan(z'/y')= arctan((z-w)/(y-v))

在Python中:

v1 = np.array([3,4,4])
v2 = np.array([1,2,6])
v = v1 - v2

a = np.degrees(np.arctan(v[0]/v[1]))
e = np.degrees(np.arctan(v[2]/v[1]))

print('azimuth = '+str(a)+', elevation = '+str(e))

输出:

azimuth = 45.0, elevation = -45.0

(图像源)

这篇关于如何从enu向量中获得方位角和仰角的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-30 17:40