System of quadratic equations with three variables (generic form)

567 Views Asked by At

Try solve a system of equation like this one.

\begin{cases} (O_x -A_x)^2+(O_y-A_y)^2+(O_z-Az)^2=x^2 \\ (O_x -B_x)^2+(O_y-B_y)^2+(O_z-Bz)^2=y^2 \\ (O_x -C_x)^2+(O_y-C_y)^2+(O_z-Cz)^2=z^2 \end{cases}

Is there any way to express $O_x, O_y, O_z$ in terms of $A_x, A_y, A_z, B_x, B_y, B_z,C_x,C_y,C_z, x, y, z$?

4

There are 4 best solutions below

2
On

Here is a geometric solution. I would use a numerical approach, since writing out a single formula would be ugly.

$A,B,C$ are points that define a plane, and $O$ is a point outside this plane. First, make sure that the corresponding sides obey triangle inequality. I am going to skip this step. The lengths of the sides of the tetrahedron are $a=|BC|$, $b=|AC|$, $c=|AB|$, $x=|OA|$, $y=|OB|$, and $z=|OC|$. All these are known.

Then let's calculate the angles between any pair of sides, using generalized Pythagoras' theorem. For example $$\cos\angle OAB=\frac{x^2+c^2-y^2}{2xc}$$ Similarly, $$\cos\angle CAB=\frac{b^2+c^2-a^2}{2bc}$$ Now let's say $P$ is the point on plane $ABC$ where $OP$ perpendicular to $ABC$,$M$ is the point on $AB$ where a plane containing $OPM$ is perpendicular to $AB$. Then $$|AM|=x\cos\angle OAB=\frac{x^2+c^2-y^2}{2c}$$ This allows you to calculate the coordinates of point $M$: $$M_i=\frac{B_i-A_i}{c}|AM|+A_i$$ Now we calculate the lengths of $OM$ and $PM$. $$|OM|=x\sin\angle OAB=x\sqrt{1-\cos^2\angle OAB}\\|PM|=*********************$$

At this point, you have all lengths in the $\triangle POM$, which allows you to calculate any angles. In particular $$\cos\angle PMO=\frac{|PM|^2+|OM|^2-|OP|^2}{2|PM||OM|}$$

Now let's calculate point $O$. For this, we use the vector product. We know that the $COM$ plane is perpendicular to $AB$ so $\vec{OM}\times\vec{CM}$ is along vector $\vec{AB}$. We also know the magnitude of the cross product, so we write $$\vec{OM}\times\vec{PM}=\pm|OM||PM|\sin\angle PMO\frac{\vec{AB}}{c}$$

All you need is to write the components of the vector product and you have two linear systems in $O_{x,y,z}$, one for each of the signs in the above equation. Writing out explicitly the formula for this terms is tedious, but it's trivial to solve numerically.

5
On

Using algebra, you can do it. I shall assume that there is a solution.

Consider $$f_1=(O_x -A_x)^2+(O_y-A_y)^2+(O_z-A_z)^2-x^2=0 \tag 1$$ $$f_2=(O_x -B_x)^2+(O_y-B_y)^2+(O_z-B_z)^2-y^2=0 \tag 2$$ $$f_3=(O_x -C_x)^2+(O_y-C_y)^2+(O_z-C_z)^2-z^2=0 \tag 3$$

Develop $f_2-f_1$ and $f_3-f_1$; the are linear equations that you can solve for $O_y$ and $O_z$ as linear functions of $O_x$.

Plug these results in $(1)$; this gives a quadratic equation in $O_x$.

The only problem is that the expressions are really too messy to be reported here.

8
On

We use uppercase letters for vectors and points. WLOG, $C=0$ (otherwise, translate all points by $-C$).

The equations of the spheres are

$$(O-A)^2=a^2,\\(O-B)^2=b^2,\\O^2=c^2.$$

Geometrically, the two solution points are the intersections of the line common to the three planes defined by the pairwise intersections of the spheres (planes of support of circles). This line is orthogonal to the plane $ABC$.

Let the piercing point of the line in $ABC$ be the point $P$. The plane $ABC$ can be described as a linear combination of $CA,CB$, simply written

$$P=\lambda A+\mu B.$$

The two planes of support of the intersection of the spheres $S_A,S_C$ and $S_B,S_C$ are obtained by subtraction of the sphere equations, giving

$$(2P-A)A=c^2-a^2,\\(2P-B)B=c^2-b^2.$$

By substituting the value of $P$, you get

$$2\lambda\,A^2+2\mu\,A\cdot B=A^2+c^2-a^2, \\2\lambda\,A\cdot B+2\mu\,B^2=B^2+c^2-b^2.$$

This is a $2\times2$ system of equations in $\lambda,\mu$, which allows you to get $P$.

Next, the direction of the line is given by the cross product $$Q:=A\times B$$

and its parametric equation is

$$P+Q\,t$$ which you plug in the equation of the third sphere:

$$(P+Q\,t)^2=Q^2t^2+2P\cdot Q\,t+P^2=c^2.$$

Solve for $t$ and you are done.

0
On

OK lets check this out I'll replace $x \ y \ z$ with $a\ b\ c$ to prevent name collision with function independent variables.

\begin{cases} (O_x -A_x)^2+(O_y-A_y)^2+(O_z-A_z)^2=a^2 \ ①\\ (O_x -B_x)^2+(O_y-B_y)^2+(O_z-B_z)^2=b^2 \ ②\\ (O_x -C_x)^2+(O_y-C_y)^2+(O_z-C_z)^2=c^2 \ ③ \end{cases}

$④=①-②$ and $⑤=②-③$ we get

\begin{cases} 2(A_x-B_x)O_x+2(A_y-B_y)O_y+2(A_z-B_z)O_z-A_x^2-A_y^2-A_z^2+B_x^2+B_y^2+B_z^2+a^2-b^2=0;\ ④ \\ 2(B_y-C_y)O_y+2(B_z-C_z)O_z+2(B_x-C_x)O_x-B_y^2-B_z^2-B_x^2+C_y^2+C_z^2+C_x^2+b^2-c^2=0;\ ⑤ \end{cases}

eliminate $O_y$ in $④$ and $O_z$ in $⑤$

\begin{cases} O_y=\frac{(B_z-C_z)(A_x^2+A_y^2+A_z^2-a^2)/2+(C_z-A_z)(B_x^2+B_y^2+B_z^2-b^2)/2+(A_z-B_z)(C_x^2+C_y^2+C_z^2-c^2)/2-(A_x(B_z-C_z)+B_x(C_z-A_z)+C_x(A_z-B_z))*O_x}{A_y(B_z-C_z)+B_y(C_z-A_z)+C_y(A_z-B_z)} \\ \\ O_z=\frac{(A_y-B_y)(C_z^2+C_x^2+C_y^2-c^2)/2+(B_y-C_y)(A_z^2+A_x^2+A_y^2-a^2)/2+(C_y-A_y)(B_z^2+B_x^2+B_y^2-b^2)/2-(C_x(A_y-B_y)+A_x*(B_y-C_y)+B_x(C_y-A_y))O_x}{C_z(A_y-B_y)+A_z(B_y-C_y)+B_z(C_y-A_y)} \end{cases}

name

$A_\sharp =(A_x^2+A_y^2+A_z^2-a^2)/2\quad B_\sharp =(B_x^2+B_y^2+B_z^2-b^2)/2\quad C_\sharp =(C_x^2+C_y^2+C_z^2-c^2)/2\\ DET_{xy} =\begin{vmatrix}A_x&B_x&C_x\\1&1&1\\A_y& B_y&C_y\end{vmatrix}\quad DET_{xz} =\begin{vmatrix}A_x&B_x&C_x\\1&1&1\\A_z& B_z&C_z\end{vmatrix}\quad DET_{yz} =\begin{vmatrix}A_y&B_y&C_y\\1&1&1\\A_z& B_z&C_z\end{vmatrix}\\ DET_{\sharp x} =\begin{vmatrix}A_\sharp&B_\sharp&C_\sharp\\1&1&1\\A_x& B_x&C_x\end{vmatrix}\quad DET_{\sharp y} =\begin{vmatrix}A_\sharp&B_\sharp&C_\sharp\\1&1&1\\A_y& B_y&C_y\end{vmatrix}\quad DET_{\sharp z} =\begin{vmatrix}A_\sharp&B_\sharp&C_\sharp\\1&1&1\\A_z& B_z&C_z\end{vmatrix}\quad$

$$ \bbox[,border:2px solid red] { \begin{aligned} &\qquad \text{ An interesting property to notice is}\\ & DET_{xz}DET_{\sharp y}-DET_{xy}DET_{\sharp z}=DET_{yz}DET{\sharp x}\\ &\qquad \quad also \quad DET_{xy}=-DET_{yx} \end{aligned} }$$

renaming $O_y$ and $O_z$ to

\begin{cases} O_y=\frac{(B_z-C_z)*A_\sharp+(C_z-A_z)*B_\sharp+(A_z-B_z)*C_\sharp+DET_{xz}*O_x}{-DET_{yz}} \\ \\ O_z=\frac{(A_y-B_y)*C_\sharp+(B_y-C_y)*A_\sharp-(C_y-A_y)*B_\sharp+DET_{xy}*O_x}{DET_{yz}} \end{cases}

and further simplifies to

\begin{cases} O_y=\frac{\ DET_{\sharp z}-DET_{xz}*O_x}{DET_{yz}} \quad ⑥\\ O_z=\frac{-DET_{\sharp y}+DET_{xy}*O_x}{DET_{yz}} \quad ⑦ \end{cases}

Substitute $O_x$ and $O_y$ into $①$

$O_x^2-2A_xX+A_x^2-a^2 +\bigl[(\frac{DET_{\sharp z}-DET_{xz}O_x}{DET_{yz}})^2-2(\frac{DET_{\sharp z}-DET_{xz}O_x}{DET_{yz}})A_y+A_y^2\bigr] +\bigl[(\frac{-DET_{\sharp y}+DET_{xy}O_x}{DET_{yz}})^2-2(\frac{-DET_{\sharp y}+DET_{xy}O_x}{DET_{yz}})A_z+A_z^2\bigr]=0$

and further reduce to

$(DET_{xy}^2+DET_{yz}^2+DET_{xz}^2) -2(DET_{yz}^2A_x+DET_{xz}(DET_{\sharp z}-DET_{yz}Ay)+DET_{xy} (DET_{\sharp y}+DET_{yz}A_z))O_x +DET_{yz}^2(A_x^2-a^2) +(DET_{\sharp z}-DET_{yz}Ay)^2+(DET_{\sharp y-DET_{yz}Az})^2=0$

then we can solve $O_x$ using "Quadratic formula" $ Ox=\frac{DET_{yz}^2A_x+DET_{xz}(DET_{\sharp z}-DET_{yz}A_y)+DET_{xy}(DET_{\sharp y}+DET_{yz}A_z) \pm \sqrt{ -DET_{yz}^2(DET_{\sharp z}-DET_{yz}A_y)(DET_{\sharp z}-DET_{yz}A_y-2DET_{xz}A_x) -DET_{yz}^2(DET_{\sharp y}+DET_{yz}A_z)(DET_{\sharp y}+DET_{yz}A_z-2DET_{xy}A_x) -(DET_{xz}(DET_{\sharp y}+DET_{yz}A_z)-DET_{xy}(DET_{\sharp z}-DET_{yz}A_y))^2 -DET_{yz}^2(DET_{xz}^2+DET_{xy}^2)A_x^2 +DET_{yz}^2(DET_{xy}^2+DET_{yz}^2+DET_{xz}^2)a^2}} {DET_{xy}^2+DET_{yz}^2+DET_{xz}^2} $

substitude $O_x$ into $⑥\ ⑦$ we get $O_y\ O_z$

or interestingly because $O_x O_y O_z$ are in symmetrical position all you have to do is to swap all $x \leftrightarrow y$ or $x \leftrightarrow z$ to get O_y and O_z

$ Oy=\frac{DET_{xz}^2A_y+DET_{yz}(DET_{\sharp z}-DET_{xz}A_x)+DET_{yx}(DET_{\sharp x}+DET_{xz}A_z) \pm \sqrt{ -DET_{xz}^2(DET_{\sharp z}-DET_{xz}A_x)(DET_{\sharp z}-DET_{xz}A_x-2DET_{yz}A_y) -DET_{xz}^2(DET_{\sharp x}+DET_{xz}A_z)(DET_{\sharp x}+DET_{xz}A_z-2DET_{yx}A_y) -(DET_{yz}(DET_{\sharp x}+DET_{xz}A_z)-DET_{yx}(DET_{\sharp z}-DET_{xz}A_x))^2 -DET_{xz}^2(DET_{yz}^2+DET_{yx}^2)A_y^2 +DET_{xz}^2(DET_{yx}^2+DET_{xz}^2+DET_{yz}^2)a^2}} {DET_{yx}^2+DET_{xz}^2+DET_{yz}^2} $

$ Oz=\frac{DET_{yx}^2A_z+DET_{zx}(DET_{\sharp x}-DET_{yx}A_y)+DET_{zy}(DET_{\sharp y}+DET_{yx}A_x) \pm \sqrt{ -DET_{yx}^2(DET_{\sharp x}-DET_{yx}A_y)(DET_{\sharp x}-DET_{yx}A_y-2DET_{zx}A_z) -DET_{yx}^2(DET_{\sharp y}+DET_{yx}A_x)(DET_{\sharp y}+DET_{yx}A_x-2DET_{zy}A_z) -(DET_{zx}(DET_{\sharp y}+DET_{yx}A_x)-DET_{zy}(DET_{\sharp x}-DET_{yx}A_y))^2 -DET_{yx}^2(DET_{zx}^2+DET_{zy}^2)A_z^2 +DET_{yx}^2(DET_{zy}^2+DET_{yx}^2+DET_{zx}^2)a^2}} {DET_{zy}^2+DET_{yx}^2+DET_{zx}^2} $