# Synthesis of Four-Link Initial Kinematic Chains with Spherical Pairs for Spatial Mechanisms
## 2 Materials and Methods
\begin{bmatrix}\sum_{i=1}^{N}x_{Bi}^{2}&\sum_{i=1}^{N}x_{Bi}y_{Bi}&\sum_{i=1} ^{N}x_{Bi}z_{Bi}&\sum_{i=1}^{N}x_{Bi}\\ \sum_{i=1}^{N}x_{Bi}y_{Bi}&\sum_{i=1}^{N}y_{Bi}&\sum_{i=1}^{N}y_{Bi}z_{Bi}&\sum _{i=1}^{N}y_{Bi}\\ \sum_{i=1}^{N}x_{Bi}z_{Bi}&\sum_{i=1}^{N}y_{Bi}z_{Bi}&\sum_{i=1}^{N}z_{Bi}^{2} &\sum_{i=1}^{N}z_{Bi}\\ \sum_{i=1}^{N}x_{Bi}&\sum_{i=1}^{N}y_{Bi}&\sum_{i=1}^{N}z_{Bi}&N\end{bmatrix}  \times \begin{bmatrix}x_{B}\\ y_{B}\\ z_{B}\\ H_{2}\end{bmatrix} =\frac{1}{2} \begin{bmatrix}\sum_{i=1}^{N}R_{B_{i}}^{2}x_{B_{ i}}\\ \sum_{i=1}^{N}R_{B_{i}}^{2}y_{Bi}\\ \sum_{i=1}^{N}R_{B_{i}}^{2}z_{Bi}\\ \sum_{i=1}^{N}R_{B_{i}}^{2}z_{Bi}\\ \sum_{i=1}^{N}R_{B_{i}}^{2}\end{bmatrix}  \tag{34}\]  
Again using Cramer's Rule, the solution for the unknowns \(x_{B}\), \(y_{B}\), \(z_{B}\), \(H_{2}\) is given by  
\[(x_{B},y_{B},z_{B},H_{2})=\frac{1}{D_{2}}(D_{x_{B}},D_{y_{B}},D_{z_{B}},D_{H_{ 1}}),\ (\text{at }D_{2}\ \
eq\ 0) \tag{35}\]  
where \(D_{2}\) is the determinant of the coefficient matrix on the left-hand side. \(D_{X_{B}}\), \(D_{Y_{B}}\), \(D_{Z_{B}}\), \(D_{H_{2}}\) are the determinants of the matrices obtained by replacing the corresponding columns with the right-hand side vector. We again apply Cramer's Rule to solve the system of equations, this time for the parameters \(x_{C}\), \(y_{C}\), \(z_{C}\), \(H_{3}\). Let us break this down:  
\[ \begin{bmatrix}\sum_{i=1}^{N}x_{Ci}^{2}&\sum_{i=1}^{N}x_{Ci}y_{Ci}&\sum_{i=1} ^{N}x_{Ci}z_{Ci}&\sum_{i=1}^{N}x_{Ci}\\ \sum_{i=1}^{N}x_{Ci}y_{Ci}&\sum_{i=1}^{N}y_{Ci}&\sum_{i=1}^{N}y_{Ci}z_{Ci}& \sum_{i=1}^{N}y_{Ci}\\ \sum_{i=1}^{N}x_{Ci}z_{Ci}&\sum_{i=1}^{N}y_{Ci}z_{Ci}&\sum_{i=1}^{N}z_{Ci}^{2} &\sum_{i=1}^{N}z_{Ci}\\ \sum_{i=1}^{N}x_{Ci}&\sum_{i=1}^{N}y_{Ci}&\sum_{i=1}^{N}z_{Ci}&N\end{bmatrix}  \times \begin{bmatrix}x_{C}\\ y_{C}\\ z_{C}\\ H_{3}\end{bmatrix} =\frac{1}{2} \begin{bmatrix}\sum_{i=1}^{N}R_{C_{i}}^{2}x_{C_{i}} \\ \sum_{i=1}^{N}R_{C_{i}}^{2}y_{Ci}\\ \sum_{i=1}^{N}R_{C_{i}}^{2}z_{Ci}\\ \sum_{i=1}^{N}R_{C_{i}}^{2}\end{bmatrix}  \tag{36}\]By Cramer's Rule, the solution for the unknowns \(x_{C}\), \(y_{C}\), \(z_{C}\), \(H_{3}\) is given by  
\[(x_{C},y_{C},z_{C},H_{3})=\frac{1}{D_{3}}(D_{x_{C}},D_{y_{C}},D_{z_{C}},D_{H_{3} })\ (\text{at}\ D_{3}\ \
eq\ 0) \tag{37}\]  
where \(D_{3}\) is the determinant of the coefficient matrix on the left-hand side. \(D_{X_{C}},D_{Y_{C}},D_{Z_{C}},D_{H_{3}}\) are the determinants of the matrices obtained by replacing the corresponding columns of the coefficient matrix with the right-hand side vector [21]. Eliminating the first four unknowns \(X_{A}\), \(Y_{A}\), \(Z_{A}\), \(R\) based on Formula (31), we can reduce system Equation (18) to a system of six equations with six unknowns, which can be conveniently represented as  
\[ \begin{array}{l}\sum_{i=1}^{N}\Delta_{qi}^{(1)}\frac{\partial\Delta_{qi}^{(2) }}{\partial x_{B}}=0;\ \sum_{i=1}^{N}\Delta_{qi}^{(1)}\frac{\partial\Delta_{i}^{(3)}}{ \partial x_{C}}=0;\\ \sum_{i=1}^{N}\Delta_{qi}^{(1)}\frac{\partial\Delta_{qi}^{(2)}}{\partial x_{ B}}=0;\ \sum_{i=1}^{N}\Delta_{qi}^{(1)}\frac{\partial\Delta_{i}^{(3)}}{ \partial y_{C}}=0;\\ \sum_{i=1}^{N}\Delta_{qi}^{(1)}\frac{\partial\Delta_{i}^{(2)}}{\partial x_{B}}= 0;\ \sum_{i=1}^{N}\Delta_{qi}^{(1)}\frac{\partial\Delta_{i}^{(3)}}{ \partial z_{C}}=0\end{array}  \tag{38}\]  
\(\Delta q_{i}^{(1)}\), \(\Delta q_{i}^{(2)}\), and \(\Delta q_{i}^{(3)}\) are the weighted differences defined earlier, which depend on the coordinates of the points \(A\), \(B\), and \(C\), as well as the constant radius \(R\).