Angle between tangent on circle and a line to a point on a larger concentric circle I have two concentric circles, the smaller one has radius $r$ and the larger one radius $r+a$. I am trying to calculate the angle between the tangent line at a point $A$ on the smaller circle and the line from point $A$ to point a $B$ on the larger circle. I made this diagram to illustrate my problem.

The angle I want to find is angle $\beta$.
Distances $a$ (between $B$ and $D$), $d$ (along the circumference of the inner circle), and $r$ are known. With this information, I can calculate angles $\alpha$, $\delta$, and distance $b$, angles $\epsilon$ and $\theta$, as well as the supplementary angles $\delta'$ and $\theta'$ (not drawn to avoid clutter).
Intuitively I see that triangles $ABD$ and $ABE$ are now fully defined but I am not able to work out angles $\beta$ and $\eta$.
How do I solve this problem? I want to code this problem with single-precision floating-point numbers in C++ so a computationally efficient solution is preferred.
EDIT: In this example point $B$ lies "above the horizon" as seen from point $A$. Is it also possible to calculate angle $\beta$ when $B$ is below the horizon?

Firstly, $\angle ACB=\frac dr$
Then, using the Sine Rule in $\triangle ABC$, you have $$\frac{r+a}{\sin(90+\beta)}=\frac{f}{\sin(\frac dr)}$$
So if you first work out $f$ using the Cosine Rule:$$f^2=r^2+(r+a)^2-2r(r+a)\cos(\frac dr)$$
Then you can calculate $\beta$
When $B$ is below the horizon, you just have to change from $90+\beta$ to $90-\beta$ in the above.
