Geometry problem about angles and triangles I've been working on this problem for a while. It doesn't seem to hard, but I cannot reach a satisfying solution.

The triangle $ABC$ is isosceles with base $\overline{AC}$. A point $O$ is also given.
Knowing: $\overline{OA}=R$, $\overline{AB}\equiv \overline{BC}=r$ and the angles $\widehat{OAB}=\varphi$, $\widehat{AOC}=\theta$, find the values of $\overline{OC}$ and $\widehat{OCB}$.

Blue objects are known, red are not.
Original (equivalent but messier) formulation:

On the plane $\pi$, two half lines: $s$, $t$ start from a point $O$ forming an angle $\theta$ between them.
A point $A$ is given on the line $s$ and a point $B$ is given on the plane $\pi$ such that $\overline{AB} >\text{dist}(B,t)$.
Find the biggest $\overline{OC}$ such that $\overline{AB}\equiv\overline{BC}$ with $C$ lying on the line $t$. What are the values of the segment $\overline{OC}$ and of the angle $\widehat{OCB}$?

So far I've been able to get:
$\widehat{CBA}=\widehat{AOC}+\widehat{OAB}+\widehat{OCB}$
which still contains two unknowns. I should have worked out a complete system of equations using triangles sine and cosine formulas, but then the substitutions become messy and I cannot reach anything as simple as the problem seems. Thanks for any hint!
 A: I'm going to take as starting data the following, using your first formulation of things. 
\begin{align}
\newcommand{\uvec}{{\bf u}}
\newcommand{\wvec}{{\bf w}}
P &= (x, y), \text{the coordinates of your point $O$, which I'll call $P$}\\
B &= (s, t), \text{the coordinates of $B$}\\
A &= (a, b), \text{the coordinates of $A$}\\
\uvec &= (h, k), \text{a vector pointing from $P$ towards $C$}
\end{align}
Thus points on the ray you called $t$ are all of the form 
$$
P + c \uvec
$$
for some nonnegative number $c$. 
Let
\begin{align}
r &= \sqrt{(s-a)^2 + (t-b)^2}, \text{the distance from $A$ to $B$}
\end{align}
For any value of $c$, we know that the vector from $P + c \uvec$ to $B$ is 
\begin{align}
{\bf w} &= P + c\uvec - B \\
&= c \uvec + (P-B) \\
&= c (h, k) + (x-s, y-t) \\
&= (ch + x-s, ck + y - t). 
\end{align}
We'd like to pick $c$ so that the length of $\wvec$ is exactly $r$, or, equivalently, so that its squared length is $r^2$. That means solving
\begin{align}
(ch + x-s)^2 + (ck + y - t)^2 = r^2 
\end{align}
Expanding out the left-hand side, we get
\begin{align}
c^2h^2 + 2ch(x-s)+ (x-s)^2 + c^2k^2 + 2ck(y - t) + (y-t)^2 &= r^2\\ 
c^2(h^2 + k^2) + c\left(2h(x-s) + 2k(y - t) \right) + (x-s)^2 + (y-t)^2 - r^2 &= 0. 
\end{align}
That's a quadratic expression in $c$, whose roots are
\begin{align}
c &= \frac{1}{2(h^2 + k^2)}\left(-\left(2h(x-s) + 2k(y - t) \right) \pm \sqrt{\left(2h(x-s) + 2k(y - t) \right)^2 - 4(h^2 + k^2)((x-s)^2 + (y-t)^2 - r^2)}\right) 
\end{align}
The larger of these two roots finds the point farther along the ray from $P$; that larger root is 
\begin{align}
c &= \frac{1}{2(h^2 + k^2)}\left(-\left(2h(x-s) + 2k(y - t) \right) + \sqrt{\left(2h(x-s) + 2k(y - t) \right)^2 - 4(h^2 + k^2)((x-s)^2 + (y-t)^2 - r^2)}\right) 
\end{align}
and the resulting point, $C$, is at the location
$$
(x_c, y_c) = (x + ch, y + ck)
$$
where $c$ is the expression given above. 
A: Referring to the figure below, 
(1) my ‘Ø’ is the same as your ‘φ’; (2) O and B are joined; (3) let OC cut AB at D.

Let p, q, s, t be the names of some functions.
In ⊿OAB, OB = p(R, r, Ø) ---- [cosine law] ---&--- x = q(R, OB, Ø) ---- [sine law]
In ⊿OBD, y = θ + Ø ---- [ext. < of ⊿] ---&--- z = π – x – y ---- [< sum of ⊿]
In ⊿OCB, [<]OCB = m = s(OB, r, z) ---- [sine law]
In ⊿BDC, n = y – m = θ + Ø – m ---- [ext < of ⊿]
In ⊿OBC, OC = t(OB, r, x + n) ---- [cosine law]
