Reputation: 6853
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?
Upvotes: 1
Views: 2390
Reputation: 37222
(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)
Upvotes: 7
Reputation: 25593
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.
Upvotes: 2