[Math] Finding the angle between two points given their Azimuth and Elevation angles

angle

I have two points in the sky and I have their coordinates in Azimuth and Elevation angles with respect to position O. I want to find the scalar angle between the two points w.r.t. position O. Thank you so much for your help!

Best Answer

The simplest is to convert from spherical to Cartesian coordinates and take the dot product (cosine of the angle).

https://en.wikipedia.org/wiki/Spherical_coordinate_system#Cartesian_coordinates