I have been trying to find a set of equations for the magnitude and angles that describes 3 connected vectors that lie in the xy plane. These vectors represent a mechanical claw I have that I want to have some very specific properties. I previously came up with what I thought would be representative equations and tried to solve in MATLAB but came up short. (My equations I tried to come up with, which represent the sums of the x and y components and the first and second position)
The initial point of the first vector, in the first position, is located at (0,5.88) and the terminal point of the third vector is located at (0,3.87), the angle of the first vector from this starting point below the horizon in degrees is (44.86-arcsin(0.219/x1)) where x1 is the magnitude of the first vector
And in a second position, where the angles 2 and 3 and the magnitudes of all vectors are the same as in the first problem, where this time the initial point of the first vector is located at (0, 0.374), the terminal point of the third vector is located at (0.91,0.88) and the angle of the first vector below the horizon from the second starting point is (44.86-arsin(2.029/x1)), where x1 is the magnitude of the first vector.
Additionally the problem has constraints that the magnitude of vector 1 must be less than 5 and the magnitude of vector 2 must be less than 3, and the length of the third vector is between 1 and 1.5. and that none of the angles can be over 150 degrees or negative.
I'm having trouble turning this into a set of equations, I think that there are many if not infinite solutions, and its fine if the equations results in some variable being dependent on another, additionally if the equation proves to be unsolvable with the given restrictions, I could do my best to loosen some and would still love to hear a method of solution to this problem.



Rather than use vectors directly we'll use affine matrices which are block matrices of the form $$\begin{bmatrix}A & v\\0 & 1\end{bmatrix}$$ In your specific case $A$ will be $2 \times 2$, $v=[x,y]^T$, $0 = [0,0]$ and $1 = [1]$. This comes with a couple of advantages. Firstly, we can now use matrix multiplication to do vector addition. To see this let $A=I$ the $n \times n$ identity matrix then $$\begin{bmatrix}I & v\\0 & 1\end{bmatrix}\begin{bmatrix}I & u\\0 & 1\end{bmatrix}=\begin{bmatrix}I &v+u\\0 & 1\end{bmatrix}$$ and we can also store local information about transformations we want to impact the vector we've stored in $v$. Say for example we have a $2 \times 2$ rotation matrix $R_\theta$ and consider $$\begin{bmatrix}R_\theta & v\\0 & 1\end{bmatrix}\begin{bmatrix}I & u\\0 & 1\end{bmatrix}=\begin{bmatrix}R_\theta &v+R_\theta u\\0 & 1\end{bmatrix}$$
Firstly, we notice that $R_\theta$ is preserved so the rotation information is encoded. Secondly we can interpret the term $v+R_\theta u$ as first traveling along the arm $v$ then rotating some vector $u$ by $R_\theta$. Perhaps the articulation of that joint may be restricted in some way on $\theta$ in a robotics application.
Now consider a third arm $w$ with rotation $R_\phi$ represented similarly and consider $$\begin{bmatrix}R_\phi & w\\0 &1\end{bmatrix}\begin{bmatrix}R_\theta & v\\0 & 1\end{bmatrix}\begin{bmatrix}I & u\\0 & 1\end{bmatrix}=\begin{bmatrix}R_{\theta + \phi} &w+R_\phi v\\0 & 1\end{bmatrix}\begin{bmatrix}I&u\\0&1\end{bmatrix}=\begin{bmatrix}R_{\theta + \phi}&w + R_\phi v + R_{\theta + \phi}u\\0&1\end{bmatrix}$$
So here we can interpret $w + R_\phi v + R_{\theta + \phi}u$ with $w$ similarly with $w,v,u$ being initial positions then the first arm $w$ has rotated $v$ by $R_\theta$ and $u$ is rotated by $R_\phi$ from $v$ so composing both rotations we have the $R_{\theta + \phi}$ term.
Note that we've put all the trigonometry into the construction of the rotation matrices so we thankfully don't have to look at them once constructed. It just becomes matrix multiplication. Just be mindful of the order, as you'd expect with articulated robot arms or matrix multiplication.
And there is no reason we have to stop with two dimensions either. The OpenGL Transform object is a fully equipped three dimensional version often used in computer graphics. In our applications the $1$ never changes but it's useful when perspective rendering.