# Finding the constraint equation

I am trying to solve a problem on Constraint equations for a triple pendulum model, but was not able to derive a constraint equation for the last mass.

I solved constraint equations for Masses 1 and 2 as follows, correct me if i am wrong: Considering coordinates of Mass M1 as \begin{pmatrix} x1\\ y1 \end{pmatrix} Considering coordinates of Mass M2 as \begin{pmatrix} x2\\ y2 \end{pmatrix} and vectors $$_{0}^{0}r_{1} = \begin{pmatrix} x1\\ y1 \end{pmatrix}$$ $$_{1}^{0}r_{2} = \begin{pmatrix} x2-x1\\ y2-y1 \end{pmatrix}$$ Then the constraint equation for first mass will be $$x1^{2}+y1^{2}-L^{2} = 0$$ since it moves in a circle. The constraint equation for the second mass will be $$(x2 - x1)^{2}+(y2 - y1)^{2} - 2L^{2} = 0$$ The third mass will be perpendicular to the vector formed by M1 and M2, so the equation of normal(unit vector) will be $$\begin{pmatrix} x2-x1\\ y2-y1 \end{pmatrix} * \begin{pmatrix} cos(90) &&-sin(90)\\ sin(90) &&cos(90) \end{pmatrix} = \begin{pmatrix} -(y2-y1)/2L\\ (x2-x1)/2L \end{pmatrix}$$ after that i couldn'd figure out how to proceed, I would be grateful if somebody give some hint what to do next.