**Appendix A**

$$\begin{aligned} m\_{11} &= c\theta\_4(s\theta\_1 s\theta\_3 + c\theta\_1 c\theta\_2 c\theta\_3) - c\theta\_1 s\theta\_2 s\theta\_4 \\\\ m\_{12} &= -s\theta\_4(s\theta\_1 s\theta\_3 + c\theta\_1 c\theta\_2 c\theta\_3) - c\theta\_1 c\theta\_4 s\theta\_2 \\\\ m\_{13} &= c\theta\_3 s\theta\_1 - c\theta\_1 c\theta\_2 s\theta\_3 \\\\ m\_{21} &= -c\theta\_4(c\theta\_1 s\theta\_3 - c\theta\_2 c\theta\_3 s\theta\_1) - s\theta\_1 s\theta\_2 s\theta\_4 \\\\ m\_{22} &= s\theta\_4(c\theta\_1 s\theta\_3 - c\theta\_2 c\theta\_3 s\theta\_1) - c\theta\_4 s\theta\_1 s\theta\_2 \\\\ m\_{23} &= -c\theta\_1 c\theta\_3 - c\theta\_2 s\theta\_1 s\theta\_3 \\\\ m\_{31} &= c\theta\_2 s\theta\_4 + c\theta\_3 c\theta\_4 s\theta\_2 \\\\ m\_{32} &= c\theta\_2 c\theta\_4 - c\theta\_3 s\theta\_2 s\theta\_4 \\\\ m\_{14} &= L\_2(c\theta\_3 s\theta\_1 - c\theta\_1 c\theta\_2 s\theta\_3) + L\_1s\theta\_1 \\\\ m\_{24} &= -L\_2(c\theta\_1 c\theta\_3 + c\theta\_2 s\theta\_1 s\theta\_3) - L\_1c\theta\_1 \\\\ m\_{34} &= -L\_2s\theta\_2 s\theta\_3 \end{aligned}$$
