How can I calculate the radius of a circle that touches AD and DC and goes through point B of a square I'm having a lot of trouble with an exercise in which I have to calculate the radius of a circle that only touches AD and CD of a square with the side 1 length and goes through point B.
Heres my sketch:

After thinking about it for about 20 minutes, I just can't find an approach to solve this.
I just don't have any given parameters.
Does anybody have any idea on how to solve this?
 A: The circle only touches the sides, that means that the sides are tangent to the circle. Say the center of the circle is O, the touching point on DC is M, the touching point on AD is N. You can easily prove that O is on the diagonal BD (two right angle triangles DNO and DMO). Then, say the radius of the circle is denoted by $R$. The length ON=OM=$R$, and since O is on the diagonal, DNO and DMO are right angle isosceles triangles. Then ON=ND=$R$, so OD=$R\sqrt{2}$. The length of BD=$\sqrt{2}$=OB+OD=$R+R\sqrt{2}$. Therefore $R=\frac{\sqrt{2}}{1+\sqrt{2}}$
A: 
Let $I$ and $J$ be the tangent points. 
So, $OI=JO=OB=r$ and then
$$OD=r\sqrt{2} \quad \text{(Pythagoras Theorem)}$$
$$BD=BO+OD=\sqrt{2}=r+r\sqrt{2} \Rightarrow r=\frac{\sqrt{2}}{1+\sqrt{2}}$$
A: This problem is much easier in reverse. Start with a circle of radius $1$ centred at $(0,0)$ on cartesian coordinates.
Then we know 
$CD$ has the equation $y=1$
$AD$ has the equation $x=-1$
$B$ is at $\left(\sqrt{\frac 12},-\sqrt{\frac 12}\right)$.
Thus the sidelength of the square is $\sqrt{\frac 12}+1$ .

Now by scale arguments, we can say that for a square of sidelength $1$,
$R= \frac1{\sqrt{\frac 12}+1} = \frac{\sqrt2}{1+\sqrt2}$.
