I developed a robotic arm with 2 bars. I would like to move this robotic arm to a X,Y coordinate. In order to do that I can set "alfa" and "beta" angles in the motor so they move the arm to the position I want. The problem is that I came up with 2 equations and 2 variables (alfa ($\alpha$) and beta($\beta$)) and I tried really hard but I still can't isolate $\alpha$ and $\beta$ so I can calculate it's value directly, using a microcontoller.
The robotic arm is like this:
I got these equations:
$$ L_1 \cdot \cos(\alpha) + L_2 \cdot \cos(\beta) = y$$ $$ L_2 \cdot \sin(\beta) - L_1 \cdot \sin(\alpha) = x$$
I tried many methods, many trigonometry identities but still couldn't isolate $\alpha$ and $\beta$ in terms of $L_1, L_2, x$ and $y$.
I appreciate all your attention. If you want to see the robotic arm that I am trying to build, it will look like this image below:
It's basically 2 bars that you can control 2 angles and move it to exact positions.


If I were building this robot, instead of $\beta,$ I would use the angle that the two arms form relative to one another. That way as $\alpha$ changes you don't need to keep recalculating $\beta$.
I will call it $\gamma$. We can find it using the law of cosines
$x^2 + y^2 = L_1^2 + L_2^2 - 2 L_1 L_2 \cos \gamma$
$\beta = \pi - \alpha - \gamma$
Two more angles.
Lets imagine that there is a line from the origin to (x,y) closing up the triangle.
Let $\phi$ be angle at the origin.
$L_2^2 = x^2 + y^2 + L_1^2 - 2\sqrt{x^2+y^2}L_1 \cos\phi$
$\theta = \tan^{-1} \frac {y}{x}$ is the angle between the straight line from the origin to $(x,y)$ and the $x$ axis.
$\theta + \phi = 90 + \alpha$
And that should be enough tools to get you everything you need.