Inverse kinematics
$$ \class{mj-blue}{\vec{P}}, \class{mj-darkgreen}{a}, \class{mj-green}{b} $$
$$ \class{mj-blue}{\vec{P}}, \class{mj-darkgreen}{a}, \class{mj-green}{b}, \class{mj-red2}{\alpha}, \class{mj-orange2}{\beta} $$
$$
\class{mj-blue}{\vec{P}}_x = \class{mj-darkgreen}{a} \cos \class{mj-red2}{\alpha} + \class{mj-green}{b} \cos \class{mj-orange2}{\beta} \qquad
\class{mj-blue}{\vec{P}}_y = \class{mj-darkgreen}{a} \sin \class{mj-red2}{\alpha} + \class{mj-green}{b} \sin \class{mj-orange2}{\beta}
$$
$$
\class{mj-red2}{\alpha} = \tan^{-1} \tfrac{\class{mj-blue}{\vec{P}}_y}{\class{mj-blue}{\vec{P}}_x}
- \cos^{-1} \frac{
\class{mj-darkgreen}{a}^2 +
\lvert\class{mj-blue}{P}\rvert^2 -
\class{mj-green}{b}^2
}{
2\class{mj-darkgreen}{a}\lvert\class{mj-blue}{P}\rvert
} \\
\class{mj-orange2}{\beta} = \tan^{-1} \tfrac{\class{mj-blue}{\vec{P}}_y}{\class{mj-blue}{\vec{P}}_x}
+ \cos^{-1} \frac{\class{mj-green}{b}^2+\lvert\class{mj-blue}{P}\rvert^2-\class{mj-darkgreen}{a}^2}{2\class{mj-green}{b}\lvert\class{mj-blue}{P}\rvert}
$$