In this part, we will solve the system of equations algebraically via Cramer's Rule and the Quadratic formula. The results of this method are identical to those in Part I.
I'm going to go through this whole thing, because it's actually worth the exercise to see how Cramer's Rule can help you reduce a system of 4 unknowns and 4 equations, down to 1 equation with 1 unknown. So, here we go:
\[ S_1 = (x - A_1)^2 + (y - B_1)^2 + (z - C_1)^2 - (c(t_1 - d))^2 = 0 \] \[ S_2 = (x - A_2)^2 + (y - B_2)^2 + (z - C_2)^2 - (c(t_2 - d))^2 = 0\] \[ S_3 = (x - A_3)^2 + (y - B_3)^2 + (z - C_3)^2 - (c(t_3 - d))^2 = 0 \] \[ S_4 = (x - A_4)^2 + (y - B_4)^2 + (z - C_4)^2 - (c(t_4 - d))^2 = 0 \]
Subtract the last three equations from the first.
\[ S_{12} = S_1 - S_2 = \\ x2(A_2-A_1) + y2(B_2-B_1) + z2(C_2-C_1) + \\ d2c^2(t_1-t_2) + A^{2}_1 - A^{2}_2 + \\ B^{2}_1 - B^{2}_2 + C^{2}_1 - C^{2}_2 + \\ c^2(t^{2}_2 - t^{2}_1) \] \[ S_{13} = S_1 - S_3 = \\ x2(A_3-A_1) + y2(B_3-B_1) + z2(C_3-C_1) + \\ d2c^2(t_1-t_3) + A^{2}_1 - A^{2}_3 + \\ B^{2}_1 - B^{2}_3 + C^{2}_1 - C^{2}_3 + \\ c^2(t^{2}_3 - t^{2}_1) \] \[ S_{14} = S_1 - S_4 = \\ x2(A_4-A_1) + y2(B_4-B_1) + z2(C_4-C_1) + \\ d2c^2(t_1-t_4) + A^{2}_1 - A^{2}_4 + \\ B^{2}_1 - B^{2}_4 + C^{2}_1 - C^{2}_4 + \\ c^2(t^{2}_4 - t^{2}_1) \]
Represent new system of equations in vector format.
\[ u_x = \begin{bmatrix} 2(A_2-A_1) \\ 2(A_3-A_1) \\ 2(A_4-A_1) \end{bmatrix} \] \[ u_y = \begin{bmatrix} 2(B_2-B_1) \\ 2(B_3-B_1) \\ 2(B_4-B_1) \end{bmatrix} \] \[ u_z = \begin{bmatrix} 2(C_2-C_1) \\ 2(C_3-C_1) \\ 2(C_4-C_1) \end{bmatrix} \] \[ u_d = \begin{bmatrix} 2c^2(t_1-t_2) \\ 2c^2(t_1-t_3) \\ 2c^2(t_1-t_4) \end{bmatrix} \] \[ u_w = \begin{bmatrix} A^{2}_1 - A^{2}_2 + B^{2}_1 - B^{2}_2 + C^{2}_1 - C^{2}_2 + c^2(t^{2}_2 - t^{2}_1) \\ A^{2}_1 - A^{2}_3 + B^{2}_1 - B^{2}_3 + C^{2}_1 - C^{2}_3 + c^2(t^{2}_3 - t^{2}_1) \\ A^{2}_1 - A^{2}_4 + B^{2}_1 - B^{2}_4 + C^{2}_1 - C^{2}_4 + c^2(t^{2}_4 - t^{2}_1) \end{bmatrix} \] \[ S = \begin{bmatrix} S_{12} \\ S_{13} \\ S_{14} \end{bmatrix} \]
If we use the relationship \( \verb+det+( S | u_y | u_z ) = 0 \), we can solve the system of equations if we remember that the determinant is a linear operator. Now use Cramer's Rule to express the system in terms of \(x,y,z\).
\[ M_x = \\ x \begin{vmatrix} u_x & u_y & u_z \end{vmatrix} + \\ y \begin{vmatrix} u_y & u_y & u_z \end{vmatrix} + \\ z \begin{vmatrix} u_z & u_y & u_z \end{vmatrix} + \\ d \begin{vmatrix} u_d & u_y & u_z \end{vmatrix} + \\ w \begin{vmatrix} u_w & u_y & u_z \end{vmatrix} \]
Similarly, \[ M_y = \\ x \begin{vmatrix} u_x & u_x & u_z \end{vmatrix} + \\ y \begin{vmatrix} u_x & u_y & u_z \end{vmatrix} + \\ z \begin{vmatrix} u_x & u_z & u_z \end{vmatrix} + \\ d \begin{vmatrix} u_x & u_d & u_z \end{vmatrix} + \\ w \begin{vmatrix} u_x & u_w & u_z \end{vmatrix} \]
and ... \[ M_z = \\ x \begin{vmatrix} u_x & u_y & u_x \end{vmatrix} + \\ y \begin{vmatrix} u_x & u_y & u_y \end{vmatrix} + \\ z \begin{vmatrix} u_x & u_y & u_z \end{vmatrix} + \\ d \begin{vmatrix} u_x & u_y & u_d \end{vmatrix} + \\ w \begin{vmatrix} u_x & u_y & u_w \end{vmatrix} \]
Note that determinants with repeated columns equal zero. Now solve for \(x,y,z\).
\[ x = \frac{-d \begin{vmatrix} u_d & u_y & u_z \end{vmatrix} - \\ w \begin{vmatrix} u_w & u_y & u_z \end{vmatrix}}{\begin{vmatrix} u_x & u_y & u_z \end{vmatrix}} \] \[ y = \frac{-d \begin{vmatrix} u_x & u_d & u_z \end{vmatrix} - \\ w \begin{vmatrix} u_x & u_w & u_z \end{vmatrix}}{\begin{vmatrix} u_x & u_y & u_z \end{vmatrix}} \] \[ z = \frac{-d \begin{vmatrix} u_x & u_y & u_d \end{vmatrix} - \\ w \begin{vmatrix} u_x & u_y & u_w \end{vmatrix}}{\begin{vmatrix} u_x & u_y & u_z \end{vmatrix}} \]
Now substitute \(x,y,z\) back into \(S_1\) and reduce it to a quadratic equation. Then solve for \(d\) using the Quadratic formula.
Source code for part 2.