Contructed the figure here reported and known that $AB=2r$, $AC=r\sqrt{2}$ and fixed $x:=P\hat{A}C$, it is asked to find $$ y = CK + PH \sqrt{2} + PK $$
as a function of $x$.
I started with
$$PH = AP\sin x$$
but I can't see how to see the other lengths missing.
Can anyone give me some suggestions? I don't know how to go on....
Thanks.

The lines $PK$ and $KC$ both touch the circle. So if you fill the second half of the circle and add two more orthogonal lines, the circle will be boxed in a square. The points $P$ and $C$ will be on the centres of the square's edges. So $PK = KC = r$.