I am working with the geometrical situation seen in the attached hand-drawn graphic below.
The given constants are $h, w, \phi, \text{ and }R$. My aim is to find $x$ as a function of those. The general constructive idea, is that the "leg" (hypotenuse) has an angle $\phi$ with vertical. This leg extends to the point where it must intersect with the circle circumference below (the constraint). This circle has radius $R$. The triangle marked in red is isosceles - perhaps worth noting.
Ofcourse we have: $x = R (\sin \frac{\theta_1}{2}-\sin \frac{\theta_0}{2})$, where $\sin \frac{\theta_0}{2} = (w/2 + b)/2R = (w/2 + h\tan \phi)/2R$.
But how to find $\theta_1$ - and from that $x$? The solution should be valid for all values of $\phi$ from $0$ to the limit at which the aforementioned leg becomes tangent to the circle below. By the way, what is that limit?
I have tried to solve this using the laws of sines and cosines. But it always seem that I end up with a triangle-situation with too little information - or it simply becomes too complicated. I have postponed working on it until I receive some feedback. It is likely trivial but nonetheless too time-consuming for me to solve right now :)
Thanks.
An elaboration of the accepted answer by André Nicolas:
Using the mechanical coordinate method this suddenly get much easier. And that was all I needed. Great. I will just write the algebraic solutions here.
We now know the following ($R$ is now $r$):
$x = \frac{1}{2} {\sin}^2 \phi \left(2 (h+r) \cot \phi + w {\cot}^2 \phi - \sqrt{(4 r^2 - w^2) {\cot}^2 \phi -4h(h + 2r) - 4(h+r) w \cot \phi} \right)$,
$y = h+r + \frac{1}{2} (w-2 x) \cot \phi$,
and
$z = x - \frac{1}{2} w - h \tan \phi$.
The angle $\theta_1$ can now be solved directly:
$\sin {\frac{\theta_1}{2}} = \frac{1}{r}\left( \frac{1}{4}w - \frac{1}{2} h \tan \phi - z \right)$