where A B C , A D , B D , C D {\displaystyle ABC,AD,BD,CD} are know. Find the location of D {\displaystyle D} :
M A B = A + [ A D 2 + A B 2 − B D 2 2 A B 2 ] A B M A C = A + [ A D 2 + A C 2 − C D 2 2 A C 2 ] A C M B C = B + [ B D 2 + B C 2 − C D 2 2 B C 2 ] B C {\displaystyle {\begin{aligned}\mathbf {M} _{AB}=\mathbf {A} +\left[{\frac {AD^{2}+AB^{2}-BD^{2}}{2AB^{2}}}\right]\mathbf {AB} \\\mathbf {M} _{AC}=\mathbf {A} +\left[{\frac {AD^{2}+AC^{2}-CD^{2}}{2AC^{2}}}\right]\mathbf {AC} \\\mathbf {M} _{BC}=\mathbf {B} +\left[{\frac {BD^{2}+BC^{2}-CD^{2}}{2BC^{2}}}\right]\mathbf {BC} \\\end{aligned}}}
M A B + m A B N A B = M A C + m A C N A C = M B C + m B C N B C M A B x + m A B N A B x = M A C x + m A C N A C x = M B C x + m B C N B C x M A B y + m A B N A B y = M A C y + m A C N A C y = M B C y + m B C N B C y M A B z + m A B N A B z = M A C z + m A C N A C z = M B C z + m B C N B C z {\displaystyle {\begin{aligned}\mathbf {M} _{AB}+m_{AB}\mathbf {N} _{AB}&=\mathbf {M} _{AC}+m_{AC}\mathbf {N} _{AC}=\mathbf {M} _{BC}+m_{BC}\mathbf {N} _{BC}\\M_{ABx}+m_{AB}N_{ABx}&=M_{ACx}+m_{AC}N_{ACx}=M_{BCx}+m_{BC}N_{BCx}\\M_{ABy}+m_{AB}N_{ABy}&=M_{ACy}+m_{AC}N_{ACy}=M_{BCy}+m_{BC}N_{BCy}\\M_{ABz}+m_{AB}N_{ABz}&=M_{ACz}+m_{AC}N_{ACz}=M_{BCz}+m_{BC}N_{BCz}\end{aligned}}}
[ m A B m A C m B C b N A B x − N A C x 0 M A C x − M A B x N A B y − N A C y 0 M A C y − M A B y N A B y − N A C y 0 M A C z − M A B z 0 N A C x − N B C x M B C x − M A C x 0 N A C y − N B C y M B C y − M A C y 0 N A C z − N B C z M B C z − M A C z N A B x 0 − N B C x M B C x − M A B x N A B y 0 − N B C y M B C y − M A B y N A B y 0 − N B C y M B C z − M A B z ] {\displaystyle \left[{\begin{array}{ccc|c}m_{AB}&m_{AC}&m_{BC}&b\\N_{ABx}&-N_{ACx}&0&M_{ACx}-M_{ABx}\\N_{ABy}&-N_{ACy}&0&M_{ACy}-M_{ABy}\\N_{ABy}&-N_{ACy}&0&M_{ACz}-M_{ABz}\\0&N_{ACx}&-N_{BCx}&M_{BCx}-M_{ACx}\\0&N_{ACy}&-N_{BCy}&M_{BCy}-M_{ACy}\\0&N_{ACz}&-N_{BCz}&M_{BCz}-M_{ACz}\\N_{ABx}&0&-N_{BCx}&M_{BCx}-M_{ABx}\\N_{ABy}&0&-N_{BCy}&M_{BCy}-M_{ABy}\\N_{ABy}&0&-N_{BCy}&M_{BCz}-M_{ABz}\\\end{array}}\right]}
[ m A B m A C m B C ] = ( A T A ) − 1 A T b {\displaystyle {\begin{bmatrix}m_{AB}\\m_{AC}\\m_{BC}\end{bmatrix}}=(A^{T}A)^{-1}A^{T}\mathbf {b} } least squares
N D = ± A C × A B ‖ A C × A B ‖ {\displaystyle \mathbf {N} _{D}=\pm {\frac {\mathbf {AC} \times \mathbf {AB} }{\|\mathbf {AC} \times \mathbf {AB} \|}}}
M A B + m A B N A B = M A C + m A C N A C = M B C + m B C N B C {\displaystyle \mathbf {M} _{AB}+m_{AB}\mathbf {N} _{AB}=\mathbf {M} _{AC}+m_{AC}\mathbf {N} _{AC}=\mathbf {M} _{BC}+m_{BC}\mathbf {N} _{BC}}
D = M A B + m A B N A B ± [ ( M A B D ) 2 − m A B 2 ] N D D = M A C + m A C N A C ± [ ( M A C D ) 2 − m A C 2 ] N D D = M B C + m B C N B C ± [ ( M B C D ) 2 − m B C 2 ] N D {\displaystyle {\begin{aligned}\mathbf {D} &=\mathbf {M} _{AB}+m_{AB}\mathbf {N} _{AB}\pm \left[{\sqrt {(M_{AB}D)^{2}-{m_{AB}}^{2}}}\right]\mathbf {N} _{D}\\\mathbf {D} &=\mathbf {M} _{AC}+m_{AC}\mathbf {N} _{AC}\pm \left[{\sqrt {(M_{AC}D)^{2}-{m_{AC}}^{2}}}\right]\mathbf {N} _{D}\\\mathbf {D} &=\mathbf {M} _{BC}+m_{BC}\mathbf {N} _{BC}\pm \left[{\sqrt {(M_{BC}D)^{2}-{m_{BC}}^{2}}}\right]\mathbf {N} _{D}\end{aligned}}}
check:
‖ D − A ‖ = A D ‖ D − B ‖ = A B ‖ D − C ‖ = A C {\displaystyle {\begin{aligned}\|\mathbf {D-A} \|=AD\\\|\mathbf {D-B} \|=AB\\\|\mathbf {D-C} \|=AC\end{aligned}}}