I am trying to program the situation as show in figure below.
I have two circles, with centres at $(x_1,y_1)$ and $(x_2,y_2)$. The line segment connecting $(x_1,y_1)$ and $(x_2,y_2)$ makes an angle $\theta_2$ with the horizontal. I need to find the point $(h,k)$, such that the circle with this centre is tangent to the circle with centre $(x_2,y_2)$, where the line segment connecting $(x_1,y_1)$ and $(h,k)$ makes an angle $\theta_1$ with the horizon. All the three circles are of the same radius $r$.
Knowns: $(x_1,y_1)$, $(x_2,y_2)$, $r$, $\theta_1$, $\theta_2$
Unknowns: $(h,k)$.

To JeanMarie, Your two remarks are infact correct. The angles are defined with respect to circles centers.
– learner123 Feb 09 '16 at 22:54