# Finding side length for segments extending radii so as to form a tangent line

I have a circle with radius $r$ and two line segments extending radii of the circle with length $r+h_1$ and $r+h_2$ respectively (you can think of them being at height $h_i$ over the circle). Forming a triangle from these line segments, the new side is tangent to the circle. I would like to find the length of this new segment (or equivalently, the angle the triangle makes at the center of the circle).

I generated the diagram with GeoGebra (plus GIMP), I hope that makes it easier to understand.

Drawing a line from the center point to the tangent line of your segment, which we will call $x$. Note that the line from the center to $x$ is perpendicular to the tangential segment, so we can solve for the lengths of the segment on either side of $x$.
On the bottom side, we have $\sqrt{(r+h_2)^2 -r^2} =\sqrt{2rh_2 +h_2^2}$, and on the top side we similarly have the side length $\sqrt{2rh_1 + h_1^2}$. Therefore the length of that segment is exactly $\sqrt{2rh_1 +h_1^2}+\sqrt{2rh_2 + h_2^2}$.