Fitting A Semi-Circle Between Three Lines I have the general situation illustrated below. I know angles $\Theta_{1}, \Theta_{2}$ and line lengths $A$, $B$ and $C$, (where $A = a_{1} + a_{2}$ etc.). I'm trying to calculate the largest semi-circle I can fit on line $B$ (i.e., calculate r), that will (always?) be tangent to line $A$ and $C$ when the angles are acute.

So I think:
$$
r = \frac{B.sin\Theta_{1}  .sin\Theta_{2} } { sin\Theta_{1} + sin\Theta_{2} }
$$
For the cases where $A > a_{1}$ and $C > c_{1}$ (meaning A is longer than the theoretical tangent point at the angle $\Theta_{1}$ etc.). But what if $A$ was very short? Does $r$ simply become the distance to the end point of $A$? And how do I 'know' when this is the case mathematically?
EDIT: To add some clarification...

*

*This is part of a larger effort to find the largest semi-circle that will fit inside an arbitrary closed polygon.

*The lines illustrated are thus three consecutive segments of that polygon

*They may be any angle and length, and don't form a triangle unless my polygon is a triangle.

*Clearly, if the angle at either or both ends is larger than $\pi$, the semi-circle can go right to that vertex and isn't impinged upon by the next or previous segment.

The part I'm mostly struggling with is incorporating the line length in determining $r$ and the centre point. Obviously, it has an effect at any given angle:

My ultimate idea is to draw lines between every polygon vertex and calculate the largest semi-circle that will fit inside the polygon along that line. I hope that will give me a good guess at the largest generally that will fit.
EDIT 2: Specifics...

I know the blue values, how do I calculate $r$ (and thus $b_{2}$ and $b_{3}$)? ($h$ and $b_{1}$ being trivial). It seems like it should be easy...but I just can't seem to get my head around it.
 A: Based on your edit 2:$b_1=a\cdot cos(\alpha)$ and $r=b_3\cdot sin(\beta)$. Hence $r^2=b_3^2\cdot sin^2(\beta)$ 
Let $k=b_1+b_2$. Then, from the Cosine Rule: $r^2=a^2+k^2-2\cdot a\cdot k\cdot cos(\alpha)$
Equating the two expressions for $r^2$, and collecting terms around $k$, gives 
$$cos^2(\beta)\cdot k^2-2(a\cdot cos(\alpha)-b\cdot sin^2(\beta))\cdot k+a^2-b^2\cdot sin^2(\beta)=0$$
which can be solved for $k$ using the quadratic formula (it gets quite cumbersome!). Of course this gives two values, but in the example I tried, one could be easily eliminated since it was negative.
Having found $k=b_1+b_2$, $b_3$ can be readily calculated, and hence $r$.
As indicated above, I only tested this once, setting up the situation in Geogebra, measuring the angles, and drawing a circle to fit. The calculated radius and measured radius were in agreement, so hopefully this is of some use.
A: 
In the figure, $P'$ and $Q'$ are projections of $P$ and $Q$ onto $\overline{AC}$; and $P''$ is the reflection of $P$ in that segment. $M$ is the midpoint of $\overline{P''Q}$, and $S$ completes the rectangle $\square P'Q'QS$.
By the Inscribed Angle Theorem, we're guaranteed that $\angle QPP''\cong\angle P''KM$, so that the sine of that angle can be written in two ways:

$$\frac{|QS|}{|PQ|} = \frac{|P''M|}{r}
\quad\to\quad
r = \frac{|PQ||P''M|}{|QS|} = \frac{|PQ|\cdot\frac12|P''Q|}{|P'Q'|} = \frac{|PQ||P''Q|}{2\,|P'Q'|}
\tag{$\star$}$$

In terms of provided parameters, we have
$$\begin{align}
|P'Q'| &= |AC|-(|AP'|+|Q'C|) \\[4pt]
&= b - \left(a \cos\theta_1 + c\cos\theta_2\right) \tag{1}\\[6pt]
|PQ|^2 &= |P'Q'|^2 + |PS|^2 = |P'Q'|^2 + (|PP'|-|QQ'|)^2 \\[4pt]
&= |P'Q'|^2 + \left(a \sin\theta_1-c\sin\theta_2\right)^2 \tag{2}\\[6pt]
|P''Q|^2 &= |P'Q'|^2 + |P''S|^2 = |P'Q'|^2 + (|PP'|+|QQ'|)^2 \\[4pt]
&= |P'Q'|^2 + \left(a \sin\theta_1+c\sin\theta_2\right)^2 \tag{3}
\end{align}$$
Now, one readily shows that

Point $P$, respectively $Q$, is a point of tangency when
  $$
a = b\;\frac{\cos\theta_1\sin\theta_2}{\sin\theta_1+\sin\theta_2} , \quad\text{resp.}\quad
c = b\;\frac{\sin\theta_1\cos\theta_2}{\sin\theta_1+\sin\theta_2} \tag{$\star\star$} $$
For computational purposes in $(\star)$, lengths $a$ and $c$ should be taken no larger than the values given in $(\star\star)$. 

Here are some examples of the results:




The last two have the same semicircle, since it was computed from the same maximal values of $a$ and $c$ from $(5)$.
A: It looks like the line from
the intersection of
sides A and C
is the angle bisector
because of the two
perpendiculars of
length r.
