I'm trying to write formula for calculating some movement paths for a two servo "leg", first servo being $\alpha$, and second servo being $\beta$, and distance from first servo to second servo is 7 cm, and the distance from the second servo to the end of the leg is 10 cm. End of the leg has to be 7 cm right and 4 cm down from the first servo (See the geometry from the image).
Calculating the needed movement paths requires essentially figuring out a formula to calculate lengths for AC (+ BC) and ED (+ BE) OR $\alpha$ and $\beta$.
I was able to calculate the values with Wolfram alpha's system of equations solver, but I was unable to figure out the formulas I could use in my program to calculate the needed values (Wolfram alpha functions)
the geometry:

$$7\sin\alpha-10\cos\beta=-4$$$$7\cos\alpha+10\sin\beta=7$$ square them and add to each other $$49-140(\sin\alpha\cos\beta-\cos\alpha\sin\beta)+100=65$$ $$140\sin(\alpha-\beta)=84$$ $$\alpha-\beta=\arcsin\frac{84}{140}=\arcsin\frac{3}{5}$$ Now you can turn back to image
You can see that $|BF|=\frac{21}5$ and $|AF|=\frac{28}5$
So $|AG|=\frac{28}{5\cos\beta}$
Then you have $7-\frac{28}{5\cos\beta}=4\tan\beta$ from the triangle GDD'
$$7\cos\beta-4\sin\beta=\frac{28}5$$ Divide this by $\sqrt{7^2+4^2}=\sqrt{65}$ $$\frac7{\sqrt{65}}\cos\beta-\frac4{\sqrt{65}}\sin\beta=\frac{28}{5\sqrt{65}}$$ $$\beta+\arccos\frac7{\sqrt{65}}=\arccos\frac{28}{5\sqrt{65}}$$
So $\beta=\arccos\frac{28}{5\sqrt{65}}-\arccos\frac7{\sqrt{65}}$ and $\alpha=\arccos\frac{28}{5\sqrt{65}}-\arccos\frac7{\sqrt{65}}+\arcsin\frac{3}{5}$