# 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.

• I had answered your question but withdrew it when I realised you were not necessarily forming a triangle with the three line segments. Which brings me to a question: does the semi-circle have to touch line segments $A$ and $B$, or be tangents of lines $A$ and $B$ (in other words imagine lines $A$ and $B$ extending to infinity)? – robert timmer-arends Mar 20 '20 at 8:59
• I was able to prove that the expression in the original question is correct. I can provide the proof if necessary. From the proof, by extension, it follows that for $\theta_1, \theta_2 < \pi/2$ the point is always on the line segment $B$, and the tangents are always on the line segments $A$, $C$ – Aleksejs Fomins Mar 20 '20 at 9:05
• (Changing side names to lower-case ...) The "largest" semi-circle on side $b$ that will always be tangent to (the lines of) sides $a$ and $b$ is in fact the only such semi-circle. (Your formula for the radius is correct.) If $a$ is "very short" and cannot reach the "theoretical tangent point" of that semi-circle, then no semi-circle will do. (Likewise for $c$.) So, you must have $$a \geq a_1 = r \frac{\cos\theta_1}{\sin\theta_1} = b\frac{\cos\theta_1\sin\theta_2}{\sin\theta_1+\sin\theta_2} \quad\text{and}\quad c \geq c_1 = b\frac{\sin\theta_1\cos\theta_2}{\sin\theta_1+\sin\theta_2}$$ – Blue Mar 20 '20 at 9:17
• Are the ends of the segments A and C arbitrary? It would make more sense to have them end where they meet so you wouldn't have this problem. In any case your solution is always correct since it only depends on B and the two angles. – Sophie Mar 20 '20 at 9:30
• I expanded on the problem a bit to explain further what I'm attempting to do. – Kyudos Mar 22 '20 at 20:46

## 3 Answers 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)$$.

• I haven't got back to working on this, but out of interest - what did you use to make these diagrams? – Kyudos Sep 14 '20 at 1:09
• @Kyudos: I use GeoGebra for my diagrams. – Blue Sep 14 '20 at 1:14
• Looking at this further - if a and b are both shorter than the tangential points, P and Q are on the circle and the centre is on line AC and thus I can find r. However, how to solve if only one line (say AP) is shorter than its tangential point? P is on the circle, the centre is on AC but there will be a different tangential point on CQ? – Kyudos Feb 10 at 2:12
• @Kyudos: Equation $(\star)$ gives the radius in all viable cases. Viability is determined by whether $a$ and $c$ are no larger than the values calculated in $(\star\star)$. – Blue Feb 10 at 2:35
• Thanks - think I'm getting to grips with it! Thanks for the GeoGebra tip too...really cool and useful program! – Kyudos Feb 10 at 3:11

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.

• Thanks Robert, I set this up in GeoGebra and it works out. – Kyudos Feb 10 at 20:40

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.