How to find radius of a circle drawn inside a triangle, if we know the base and the distance from point to the circle
Here we can see the problem described in the title, we know only the distances a=3 and b=18, how would we go about solving for the circle radius?
Even though it may not look like it on the picture, the circle is tangent to all 3 sides of the triangle.

If $c$ is the length of one of the legs of the isosceles triangle, $h$ its height and $r$ the radius of the incircle, then we get the following equations: $$ \left(\frac{b}{2}\right)^2 + h^2 = c^2 \\ \frac{b + 2c}{2}\cdot r = \frac{bh}{2} \\ a+2r = h $$ The first equation is just the Pythagorean theorem applied to one half of the triangle, the second one uses two different methods of calculating the area of the triangle, and the third one is obvious.
Note: the area of a triangle can be expressed as half of the product of the perimeter of the triangle and the radius of the incircle, see here.
Let us write those equations differently: $$ h^2 = \left(c+\frac{b}{2}\right)\left(c-\frac{b}{2}\right) \\ \left(c+\frac{b}{2}\right)\left(2r\right) = bh \\ 2r = h-a $$ Putting the $2r$ from the last equation into the second one and solve the second one for $h$: $$ h=\frac{c+\frac{b}{2}}{c-\frac{b}{2}} \cdot a $$ which means $$ \left(\frac{c+\frac{b}{2}}{c-\frac{b}{2}} \cdot a\right)^2 = \left(c+\frac{b}{2}\right)\left(c-\frac{b}{2}\right) $$ or $$ \left(c-\frac{b}{2}\right)^3-\left(c+\frac{b}{2}\right)a^2 = 0 $$ Now we substitute $x=c-\frac{b}{2}$ and we get $$ x^3 - a^2x -a^2b = 0 $$ In general, there is no "nice" solution to this cubic equation, but with the given numbers $a=3$ and $b=18,$ we get $x=6$. (Use, for example, the rational root theorem and check all integer factors of $a^2b$.) From here, it is easy to obtain
$c=x+\frac{b}{2} = 6+9 = 15,$ $h=\sqrt{c^2-\left(\frac{b}{2}\right)^2} = \sqrt{15^2-9^2} = 12$ and $r=\frac12(h-a) = 4.5.$