Imagine an isosceles triangle with base length A and the length of the other two sides is B. For this calculation you also need the angles of the triangle. Call the angle at the top of the triangle (where the two same length sides meet) angle a and the other angle b.
In this triangle there sits a circle such that it touches each of the three sides at one point. By definition these sides are tangential to the circle. Because of this, the radius of the circle meets the sides at a right angle.
If you bisect the triangle A,B,B into a right angled triangle so that the angles are 90°, a/2° and b°, it is easier to work with. The base of this triangle will thus be A/2. Call this triangle A/2,B,C and the side bisecting A,B,B we shall call C.
The radius between the circles centre to the point it touches on line B, let us call D. There is then another right angled triangle bordered by the line D, and parts of lines B and C. If we label the portion of C which borders the line C as E, then we can see that E+r=C. By the sine theorem:
if we know the length of side C and angle b, this gives us the length of A/2.
The sine theorem can also be used to calculate E. As we know the angle at the top (b/2) and its opposite side (r), we can calculate E as the opposite angle to it is a right angle.
Now we have E we can see that C=E+r thus
Using again the sine theorem:
Rearrange that as
This then gives the final answer of
or equivalently, as a=180°-2b