I want to find the $x, y, z$ coordinates for $4$ points in a 3D space. Point $A$ is my origin $(X, Y, Z = 0,0,0)$ and other points $B, C, D$ are with reference to point A. I know all six distances from $A \to B, A\to C, A\to D, B\to C, B\to D$, and $C\to D$.
Point $B$ lies on axis $X$, point $C$ lies in $XY$ plane, and lastly, point $D$ can be anywhere.
Coordinates of the points $A, B, C, D$ are as follows:
$A = (0, 0, 0)$
$B = (X_B, 0, 0)$
$C = (X_C, Y_C, 0)$
$D = (X_D, Y_D, Z_D)$
It is straightforward to determine $X_B$, $X_C$, and $Y_C$. I am having difficulty finding X, Y, Z coordinate of the point D with respect to the point A.
To determine Xd, Yd, Zd, I am using the following equations
$(X_D-X_A)^2 + (Y_D-Y_A)^2 + (Z_D-Z_A)^2 = AD^2$
$(X_D-X_B)^2 + (Y_D-Y_B)^2 + (Z_D-Z_B)^2 = BD^2$
$(X_D-X_C)^2 + (Y_D-Y_C)^2 + (Z_D-Z_C)^2 = CD^2$
After doing some expansion and eliminating the 2nd order variables I came up with the following:
$Ax = b$
$x = (X_D, Y_D, Z_D)$
after doing the pseudo inverse on both sides I can solve for x. I am not sure if my method of solving $X_D$, $Y_D$, and $Z_D$ is correct.