I have an UAV modeled in three dimensions with let's say position coordinates $p_{uav} = (x_1,y_1,z_1)$ that is moving in a direction $d = (d_x,d_y,d_z)$ and a moving obstacle modeled as a sphere with known centre coordinates $p_{sph}=(x_2,y_2,z_2)$ and radius $ r_{sph}$.
If I have a plane $p$ in the direction of movement of the UAV that intersects the sphere, I want to be able to calculate the angles with respect to the vehicle's movement formed by the tangents to the sphere in the plane $ p$. In the figure, I would like to know how to calculate the angles $α_1$ and $α_2$.
If it helps, what I am looking is an extension in three dimensions for this:
Which is a vehicle in two dimensions ;it is obviously an easier problem which requires only the centre of the circle. However I am not really sure how to make it work in 3D, as supposedly the plane can intersect the sphere at any two points, not necessarily the centre.
Thanks in advance for your help.