Angle matching in a quadrilateral with a single unknown vertex Three vertices of a quadrilateral are known (green)

with the fourth vertex (red) is unknown. The angles from the unknown vertex to the other three are also known (green a and b in the diagram). I need to work out the single position for the fourth vertex which satisfies the two angular constraints (a and b).
Here is a link to a GeoGebra visualisation of the problem:
Vertex Position
This is the second time of posting this (the first I deleted), as the first time I don't believe I put enough description for people to understand the full scope of the problem.
This is a stage within the software of a home-brew VR tracking device I am working on. It attempts to match the calculated pattern of sensors (purple dots) given by a “best guess” base position (red dot). The actual readings from the device (green dots) are then compared in groups of three by angle matching against the same sensors and angles.  When all the centers given by the groups of three converge, then the “best guess” bearing for the base is the actual bearing for the base. If the centers diverge, then the guess must be refined and the process re-done.
See the image here:

I am currently doing the centre find with the groups of three in an iterative process.  As it’s running on an embedded processor (within the device) it has to be efficient and so I am looking for a trigonometric solution to the problem.
I have tried to use sine and cosine rules with substitution to come up with an answer but my math skills just aren’t up to the job it seems.
Please keep responses to something a software undergraduate would be able to understand and implement.
Thank you in advance,
Lee
 A: I'll use different element naming conventions. The given points are $A$, $B$, $C$, with $|\overline{AC}| = a$, $|\overline{BC}| = b$, $\angle ACB = \gamma$. The desired point is $C^\prime$, such that $\angle AC^\prime C = \alpha$ and $\angle BC^\prime C = \beta$.

TL;DR:

$$C^\prime = p A + q B + r C \tag{$\star$}$$
  where
  $$\begin{align}p &:= sb \sin\beta\;( b \sin\alpha - a \sin( \alpha - k \gamma ) )\\[4pt]
q &:= sa\sin\alpha\;\left( a \sin\beta - b \sin( \beta - k \gamma) \right)\\[4pt]
r & := \frac{s\sin(\alpha+\beta) (a\sin\beta-b\sin(\beta-k\gamma))(b\sin\alpha-a\sin(\alpha-k\gamma)) }{\sin(\alpha+\beta-k\gamma)}\\[4pt]
s &:= \frac{\sin(\alpha+\beta-k\gamma)}{
\sin(k\gamma)\left(a^2 \sin^2\beta + b^2 \sin^2\alpha 
+ 2 a b \sin\alpha \sin\beta \cos(\alpha+\beta-k\gamma) 
\right)} \\[6pt]
k &:= \pm 1 \quad\text{(to handle a directional ambiguity)}
\end{align}$$ 

(Whether you want $k=+1$ or $k=-1$ depends on your layout, the handedness of your coordinate system, clockwise-ness of your angle measurements, etc.  Note that $k$ is, quite conveniently, always attached to $\gamma$, so that swapping the sign of $k$ is just a matter of swapping the sign on $\gamma$. It's not really worth thinking too much about; just try $+1$, and if it doesn't give you what you want/expect, use $-1$.) 

Deriving $(\star)$ is pretty straightforward, if symbolically messy. (Luckily, Mathematica handles the mess. It's entirely possible, though, that I've made a transcription typo or two in this answer.) Since we're going to express $C^\prime$ as a combination of $A$, $B$, $C$, we can choose convenient coordinates for those points:
$$C = (0,0) \qquad A = a(\cos\gamma,\sin\gamma) \qquad B = (b,0)$$
As in @quasi's answer, we'll exploit the Inscribed Angle Theorem. The idea is to find some $A^\prime$ and $B^\prime$ with $\angle AA^\prime C = \alpha$ and $\angle BB^\prime C = \beta$; then, the $C^\prime$ is the "other" point of intersection of the circles with diameters $\overline{A^\prime C}$ and $\overline{B^\prime C}$. A convenient choice of $A^\prime$ completes right triangle $\triangle CAA^\prime$ with legs $a$ and $a\cot\alpha$. Likewise for $B^\prime$. So, we can write
$$\begin{align}
A^\prime &= A + k \cot\alpha\;((C-A)_y,-(C-A)_x) \\
B^\prime &= B - k \cot\beta\;((C-B)_y,-(C-B)_x)
\end{align}$$ 
with $k=\pm 1$, which chooses one of two possible points $A^\prime$. The compatible choice for $B^\prime$ uses $-k$.
Our circles are centered at the midpoints of $\overline{A^\prime C}$ and $\overline{B^\prime C}$:
$$\begin{align}
\bigcirc M:\quad &\left(x^2+y^2\right)\sin\alpha - x a\sin(\alpha-k\gamma) 
- y ka \cos(\alpha-k\gamma)= 0 \\
\bigcirc N:\quad &\left(x^2+y^2\right)\sin\beta - x b \sin\beta + y k b \cos\beta = 0
\end{align}$$
The circles meet at $C$ and
$$C^\prime := sab\sin(k\gamma)\;\left(\;b \cos\beta \sin\alpha + a \sin\beta \cos(\alpha-k\gamma)\;,\;k\sin\beta ( b \sin\alpha - a \sin(\alpha-k\gamma) )\;\right)
$$
where
$$s := \frac{\sin(\alpha+\beta-k\gamma)}{\sin(k\gamma)(
a^2 \sin^2\beta + b^2 \sin^2\alpha 
+ 2 a b \sin\alpha \sin\beta \cos(\alpha+\beta-k\gamma) 
)}$$
From here, we solve $C^\prime = p A + q B$ for $p$ and $q$. Translating for a non-origin $C$ gives $C^\prime = C + p(A-C) + q (B-C) = p A + q B + (1-p-q)C$, leading to the expressions in $(\star)$. $\square$
A: Here's an outline of one way . . .


*

*Label the red point as $X$.$\\[4pt]$

*Label the green points as $U,V,W$, from left to right.$\\[4pt]$

*Let $M$ be the midpoint of segment $VU$.$\\[4pt]$

*Construct the perpendicular bisector $VM_\bot$ of segment $VU$.$\\[4pt]$

*If $a=90^\circ$, set $P=M$.$\\[4pt]$

*If $a\ne90^\circ$, let $P$ be the point on $VM_\bot$ such that 

*

*$\angle MPV=a$, or equivalently, $|MP|=|MV||\cot a|$. $\\[4pt]$

*and such that segment $MP$ 

*

*does not go inside triangle $UVW$ if $a < 90^\circ$.$\\[4pt]$

*does not go outside triangle $UVW$ if $a > 90^\circ$.$\\[4pt]$



*Let $N$ be the midpoint of segment $VW$.$\\[4pt]$

*Construct the perpendicular bisector $VN_\bot$ of segment $VW$.$\\[4pt]$

*If $b=90^\circ$, set $Q=N$.$\\[4pt]$

*If $b\ne90^\circ$, let $Q$ be the point on $VN_\bot$ such that 

*

*$\angle NQV=b$, or equivalently, $|NQ|=|NV||\cot b|$. $\\[4pt]$

*and such that segment $NQ$ 

*

*does not go inside triangle $UVW$ if $b < 90^\circ$.$\\[4pt]$

*does not go outside triangle $UVW$ if $b > 90^\circ$.$\\[4pt]$



*Construct the circle centered at $P$ with radius $|PV|$.$\\[4pt]$

*Construct the circle centered at $Q$ with radius $|QV|$.$\\[4pt]$


Then $X$ is one of the intersection points of the two circles.
