Determine the position of a point in 3D space given the distance to N points with known coordinates

前端 未结 3 1638
自闭症患者
自闭症患者 2020-12-30 17:52

I am trying to determine the (x,y,z) coordinates of a point p. What I have are the distances to 4 different points m1, m2, m3, m4 with known coordinates.

In detail:

相关标签:
3条回答
  • 2020-12-30 18:13

    mathematica readily numericall solves the three point problem:

    p = Table[ RandomReal[{-1, 1}, {3}], {3}]
    r = RandomReal[{1, 2}, {3}]
    Reduce[Simplify[ Table[Norm[{x, y, z} - p[[i]]] == r[[i]] , {i, 3}], 
          Assumptions -> {Element[x | y | z, Reals]}], {x, y, z}, Reals]
    

    This will typically return false as random spheres will typically not have triple intersection points.

    When you have a solution you'll typically have a pair like this..

          (*   (x == -0.218969 && y == -0.760452 &&  z == -0.136958) ||
               (x == 0.725312 && y == 0.466006 &&   z == -0.290347)  *)
    

    This somewhat surprisingly has a failrly elegent analytic solution. Its a bit involved so I'll wait to see if someone has it handy and if not and there is interest I'll try to remember the steps..

    Edit, approximate solution following Dmitys least squares suggestion:

    p = {{370, 1810, 863}, {1586, 185, 1580}, {1284, 1948, 348}, {1732, 
    1674, 1974}};
    r = {1387.5, 1532.5, 1104.7, 0855.6};
    solution = {x, y, z} /. 
                  Last@FindMinimum[ 
                         Sum[(Norm[{x, y, z} - p[[i]]] - r[[i]] )^2, {i, 1, 4}] , {x, y, z}]
    Table[ Norm[ solution - p[[i]]], {i, 4}]
    

    As you see you are pretty far from exact..

    (* solution point {1761.3, 1624.18, 1178.65} *)
    (* solution radii: {1438.71, 1504.34, 1011.26, 797.446} *)
    
    0 讨论(0)
  • 2020-12-30 18:15

    I'll answer the second question. Let's name the unknown point X. If you have only known point A and know the distance form X to A then X can be on a sphere with the center in A.

    If you have two points A,B then X is on a circle given by the intersection of the spheres with centers in A and B (if they intersect that is).

    A third point will add another sphere and the final intersection between the three spheres will give two points.

    The fourth point will finaly decide which of those two points you're looking for.

    This is how GPS actually works. You have to have at least three satellites. Then the GPS will guess which of the two points is the correct one, since the other one is in space, but it won't be able to tell you the altitude. Technically it should, but there are also errors, so the more satellites you "see" the less the error.

    Have found this question which might be a starting point.

    0 讨论(0)
  • 2020-12-30 18:23

    Take first three equation and solve i for 3 equation and 3 variables in MATLAB. After solving the equation you will get two pairs of values or we can say two set of coordinates of p. keep each set in the 4th equation and you can find out the set which satisfies the equation is the answer

    0 讨论(0)
提交回复
热议问题