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.
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.
You can calculate the azimuth and elevation angles between East-North-Up vectors (x,y,z)
and (u,v,w)
using the following:
(x,y,z) - (u,v,w) = (x-u,y-v,z-w) = (x',y',z')
a = arctan(x'/y') = arctan((x-u)/(y-v))
e = arctan(z'/y') = arctan((z-w)/(y-v))
In 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))
Output:
azimuth = 45.0, elevation = -45.0