How can I find the intersection of four spheres?

3.9k Views Asked by At

I need to program a GPS system.

So, I get: (The distances are the distance between the target and the points) \begin{align} d_1 &= 8.246211, \\ d_2 &= 7.483315, \\ d_3 &= 3.3166249, \\ d_4 &= 9.110434. \end{align} and I know the coordinates of each point: \begin{align} p_1 &= (-2580 ,61 ,-2290), \\ p_2 &= (-2574 ,61 ,-2290), \\ p_3 &= (-2577 ,59 ,-2287), \\ p_4 &= (-2577 ,58 ,-2293). \end{align} How can I get the target coordinates?

2

There are 2 best solutions below

0
On BEST ANSWER

Two spheres intersecate (if they do) in a circle that lies on a plane that is normal to the line joining the centers, and that crosses that line at a distance $d_{1,2}$ from point $C1$, that can be found by solving the triangle with the given sides, as shown

4SpheresGPS

that is $$ d_{\,1,2} = {{r_{\,1} ^{\,2} - r_{\,2} ^{\,2} + \left| {{\bf v}_{\,12} } \right|^{\,2} } \over {2\left| {{\bf v}_{\,12} } \right|}} $$ which can be either positive or negative.

The equation of the plane will then be: $$ \left( {{\bf x} - {\bf c}_{\,1} } \right) \cdot {{{\bf v}_{\,12} } \over {\left| {{\bf v}_{\,12} } \right|}} = d_{\,1,2} $$ which is the same as to write $$ \eqalign{ & \left( {x - C_{\,1,\,x} } \right) \cdot \left( {C_{\,2,\,x} - C_{\,1,\,x} } \right) + \left( {y - C_{\,1,\,y} } \right) \cdot \left( {C_{\,2,\,y} - C_{\,1,\,y} } \right) + \left( {z - C_{\,1,\,z} } \right) \cdot \left( {C_{\,2,\,z} - C_{\,1,\,z} } \right) = \cr & = {{r_{\,1} ^{\,2} - r_{\,2} ^{\,2} + \left| {{\bf v}_{\,12} } \right|^{\,2} } \over 2} \cr} $$

Do the same for other two couples of points, choosen in such a way that the three vectors $ {{\bf v}_{\,jk} }$ be oriented as much differently as possible.

Then find the point where the three planes cross, i.e. the solution to the system of the three linear equations they define.
If the 4 spheres define a unique point, then it must be that, apart of course from measurement errors/approximations. Check the distances of the cross point from the four references.

In case of big discrepances, find some other planes and find a common solution by the method of least squares, again checking vs. the known distances.

Note

If you are writing a "real applicable" program, the error checking and handling is fundamental. Then you need to know probability theory, statistics etc. (and GPS engineering, of course) to decide which method strategy to adopt.

1
On

If you have the centers of each sphere, as well as their radii, then you are able to plug those values into the equation of a sphere: $(x-x_{coord})^2 + (y-y_{coord})^2 + (z-z_{coord})^2 = r^2$

A program will be able to assist you with solving the rather messy algebraic equation that is the result

Just as José commented on your question, people who answer aren't here to do the math for you. So if you understand what I'm saying then you'll know how to solve it.