Position in Circle given coordinates of points on the edge and distance to these points

617 Views Asked by At

PREFACE: I want to preface this question by saying that yes, I know it's been asked a few times here, and yes, I know that although what I am asking is the opposite of the usual question, it is possible to invert the given solutions and apply them to my problem. The issue here being that I am VERY rusty with mathematics and I'm looking for help in figuring out an exact algorithm for the question.

THAT SAID, the question I've found asked a dozen times on this page is "Given a point in a circle, two points on the edge, and the angles to those two points, find the distance to them". See here for an example: Find coordinates for points on circle given R, 2 Points, and angle or 2 points and center?

QUESTION: My question is almost the exact opposite: Given a point X in the circle, three points A, B and C on the circle and their coordinates, and the distance between X and A, B and C, find the coordinates of point X. For example:

CONCRETE EXAMPLE: Given a circle of Radius R = 500, points A = 0;0, B = 250;-250, C = 0;-500, and the distances of the edges XA = 414, XB = 334, XC = 87, find the coordinates of point X. Edit.: To clarify, point A is the center of the circle, not a point on its edge.

ASSUMPTIONS: I assume that the solution to this problem would involve the calculation of the angles for XA, XB and XC and then the application of the formula for finding the coords of point X. I will, however, have to execute this same calculation several times over the course of my work, and would like to code a computer program to resolve it for me. I could not, unfortunately, find one on the internet, though I did find this, which is pretty close: http://www.cncexpo.com/CircleCoord.aspx

Is there anyone that could point me to, or help me reach, an algorithm for this problem? I apologize for the messiness of the question, I am not used to formulating math questions. I will, of course, gladly make the program available upon completion so it can help others with the same problem in the future.

1

There are 1 best solutions below

7
On BEST ANSWER

The length $XA=414$ means that if you draw a circle centred at $A$, with radius $414$, then this circle will pass through $X$. The same goes for $XB$ and $XC$.

This leads to a system of equations: $$(x - x_A)^2 + (y - y_A)^2 = (XA)^2\\ (x - x_B)^2 + (y - y_B)^2 = (XB)^2\\ (x - x_C)^2 + (y - y_C)^2 = (XC)^2$$

If the distances $XA, XB, XC$ are reported incorrectly, then there will be no solution; you may thus have to account for rounding errors.

Can you take it from here?

Incidentally, the radius you give in the example is wrong (it should be $250$, not $500$). But you don't need to provide the radius: it can be deduced from the positions of $A,B,C$, since any three points determine a unique circle. More critically, the example problem is impossible with the given co-ordinates and lengths. Even if we take the "best fit" point, i.e., the point that's approximately a solution, it is clearly not on the circle passing through $A,B,C$. Did you invent these numbers as an example without realizing that it was impossible? Or is there an error in the data?