Determining The Coordinates Of A Point Based On Its Known Difference From Three Other Points

落花浮王杯 提交于 2019-12-11 07:27:14

问题


I have the coordinates of three points on a plane. Let's call them X1,Y1, X2,Y2, X3 Y3.

I need to calculate X4,Y4 but all I know is:

X1,Y1 is 350 units in distance from X4,Y4 X2,Y2 is 200 units in distance from X4,Y4 X3,Y3 is 50 units in distance from X4,Y4

I Know The Exact Values For X1,Y1, X2,Y2, and X3,Y3

How can I determine the exact location of X4,Y4?


回答1:


(x - x1)^2 + (y - y1)^2 = r1^2  ------ p
(x - x2)^2 + (y - y2)^2 = r2^2  ------ q
(x - x3)^2 + (y - y3)^2 = r3^2  ------ r

Solve for intersection point of these 3 circles.

 p - q     ----- l 
 p - r     ----- n

Solve equation (l) and (n) using Cramer's rule.

GET_POINT(x1,y1,r1,x2,y2,r2,x3,y3,r3):
    A = x1 - x2
    B = y1 - y2
    D = x1 - x3
    E = y1 - y3

    T = (r1*r1 - x1*x1 - y1*y1)
    C = (r2*r2 - x2*x2 - y2*y2) - T
    F = (r3*r3 - x3*x3 - y3*y3) - T

    A x + B y = C/2  // this is equation 'l'
    D x + E y = F/2  // this is equation 'n'

    // Cramer's Rule

    Mx = (C E  - B F) /2
    My = (A F  - D C) /2
    M  = AE - DB

    x = Mx/M
    y = My/M

    return (x,y)



回答2:


You post was only tagged "geometry".

A geometric solution for your problem would be to draw circles around (x1,y1), (x2,y2) and (x3,y3) with the corresponding distance to (x4,y4) as radius. (x4,y4) is the point where all thee circles intersect.



来源:https://stackoverflow.com/questions/2507148/determining-the-coordinates-of-a-point-based-on-its-known-difference-from-three

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!