The legs of a right triangle are $a$ and $b$. Find the distance from the vertex of the right angle to the nearest point of the inscribed circle. From Sharygin's Book:

The legs of a right triangle are $a$ and $b$. Find the distance from the vertex of the right angle to the nearest point of the inscribed circle.

My solution appears in this answer.
Thank you.
 A: Hint: Imagine the triangle aligned with the right angle at the origin, and the two legs along the axes. Center of the inscribed circle is $(c,c)$. Equation of the hypotenuse can be taken as $y=-(b/a)x + b$. Also the distance between $(c,c)$ and the hypotenuse is also $c$, because of the inscription property. Now just apply the distance formula between a point and the line. This gets you the value of c, in terms of a and b. Now the required distance is simply $ \sqrt{2}c - c$.
A: We know:
$$[ABC]=\frac 1 2 ba$$
($[XYZ]$ to denote area)
Again we see, $$[ABC]=sr$$
Where $s$ denotes semi-perimeter and $r$ denotes inradius. 
Certainly, $AC=\sqrt{a^2+b^2}$
Combining both equations gives:
$$ \frac 1 2 ab=\frac 1 2(a+b+\sqrt{a^2+b^2})r$$
$$or, r=\frac {ab} {a+b+\sqrt{a^2+b^2}}$$
Clearly, $r\sqrt2$ is the value of $IB$ (the diagonal) of the square which is formed by the points of tangency due to the incircle near $B$.
The distance is their difference.
Subtracting and rationalising gives required distance:
$$(\sqrt2-1)(a+b-\sqrt{a^2+b^2})$$
