Geometry: A circle inscribed in a triangle with sides lengths of 5, 8 and 9 A friend of mine sent me this geometric question long ago. Unfortunately, we couldn't find the source of the question.

I had attempted to solve the problem but couldn't get near the answer. However, when I drew it out in Geogebra, I found that the length of the red line was 3.
I am hoping that someone might be able to solve the question using geometric approaches or theorems. Any assistance would be greatly appreciated!
 A: Here's a proof of the general result that the target segment is congruent to the tangent segment from the "top" vertex. In the problem at hand, the length is calculated as $\frac12(9+5-8) = 3$.

Let $\triangle ABC$ have incircle $\bigcirc I$ of radius $r$, meeting the sides of the triangle at $D$, $E$, $F$. Let $\overline{PQ}$ be the incircle diameter perpendicular to $\overline{CF}$, and let (extensions of) $\overline{AP}$ and $\overline{AQ}$ meet $\overline{CF}$ at $P'$ and $Q'$. Define
$$\alpha:=\tfrac12\angle A, \quad\theta:=\tfrac12\angle PIF, \quad a':=|AF|=|AE|, \quad c':=|CE|, \quad p':=|FP'|, \quad q':=|FQ'|$$
and note that
$$r = a'\tan\alpha \qquad |FP| = 2r\sin\theta = 2 a'\tan\alpha\sin\theta
\qquad |FQ| = 2a'\tan\alpha\cos\theta \tag1$$

A little angle chasing shows that $\angle PFA=\angle PFC=\theta$. This allows us to compute as follows:
$$\begin{align}
|\triangle AFP'| &= |\triangle AFP| + |\triangle PFP'|\\[6pt]
\to\quad
\frac12a'p'\sin2\theta &= \frac12a'|FP|\sin\theta+\frac12p'|FP|\sin\theta\\[6pt]
\to\quad
a'p'\cdot2\sin\theta\cos\theta &= (a'+p')\cdot2a'\tan\alpha\sin\theta\cdot \sin\theta \\[6pt]
\to\quad
p'\cos\alpha\cos\theta &= (a'+p')\sin\alpha\sin\theta \\[6pt]
\to\quad
p' &= \frac{a'\sin\alpha\sin\theta}{\cos(\alpha+\theta)} \tag1
\end{align}$$
(This seems simple enough that there should be a more-direct path to it.) Likewise, we have
$$|\triangle AFQ'| = |\triangle AFQ| - |\triangle QFQ'| \quad\to\quad
q' = \frac{a'\sin\alpha\cos\theta}{\sin(\alpha+\theta)} \tag2$$
Now, we make a somewhat unmotivated observation, using some cumbersome trigonometric manipulations,
$$p'-q' + a' = \frac{a'\sin2\theta}{\sin(2\alpha +2\theta)} = \frac{a'\sin \angle AFC}{\sin\angle ACF}\;\overset{\star}{=}\;|AC| = a'+c' \tag3$$
where equality $\star$ follows from applying the Law of Sines in $\triangle ACF$. We conclude $p'-q'=c'$. $\square$

Note 1. The construction is actually symmetric in vertices $A$ and $B$. One can show that $\overline{BP}$ and $\overline{BQ}$ meet $\overline{CF}$ in $Q'$ and $P'$, yielding the same target segment.
Note 2. We can trade the cumbersome trig for the unmotivated observation $(3)$ for less-cumbersome trig distributed across two unmotivated observations:
$$p'+\frac12a' =\frac12 a'\, \frac{\cos(\alpha-\theta)}{\cos(\alpha+\theta)}
\qquad\qquad q'-\frac12a' = \frac12a'\,\frac{\sin(\alpha-\theta)}{\sin(\alpha+\theta)} \tag4$$
Then the calculation in $(3)$ amounts to $(p'+\frac12a')-(q'-\frac12a')$. Relations $(4)$ seem like they're trying to tell me something.
Note 3. We can also calculate
$$p'+q' = \frac{a' \sin2\alpha}{\sin(2\alpha + 2\theta)} = \frac{a'\sin\angle A}{\sin\angle ACF} = |CF| = p'+|CP'| \quad\to\quad q'=|CP'| \tag5$$
This implies that $\overline{P'Q'}$ is centered in $\overline{CF}$ (ie, the two segments have the same midpoint). This seems non-obvious.
A: Hint: Draw Circumcircle of triangle ABC (A top B left C right) with radius R and center at O.We have:
$P=\frac{5+8+9}2$
$S=\sqrt{p(p-5)(p-8)(p-9)}$
$R=\frac{5\times 8\times 9}{4 S}\approx 4.5$
Mark center of circumscribed circle as $O_1$ with radius r.
$r=\frac S p\approx 1.8$
Accurate drawing shows that a circle passing points J and F (J if top point of required segment and F is it's bottom) and tangent to AC has center $O_2$ at distance equal to $OO_1$. This circle has equal radius to that of circumscribed circle r. Due to Euler's theorem:
$(OO_1)^2=R(R-2r)\approx 2$
Draw perpendiculars  $O_1H$ and $O_2G$ to side AC. The distance between $ O_2$ and JF i.e  $O_2 I\approx GH\approx 0.9$. $O_2F=r\approx 1.8$ , we have:
$JF=2\times \sqrt{1.8^2-0.9^2}\approx 2\times 1.5=3$
Note: I can not attach my figure due to the site's restriction for me. I can post the figure if I have an address.
