I have an array of points, of which(points) I know the coordinates(in my coordinate plane, x/y). Then I have a point of unknown coordinates, but I know the distance to that point from “known” points. I’m looking for “unknown” point coordinates. Should be a sort of triangulation.
I’ve thought about describing the situation with system of equations.
Let suppose this data:
coord[n] basePoints;
double[n] dist;
coord result;
Let think coord like a:
struct {
double x,y;
};
Now, the circumference equation is:
x^2 + y^2 + ax + bx + c = 0
where:
a = basePoint[i].x
b = basePoint[i].y
c = a^2 + b^2 + r^2
r = dist[i]
In this case, we need 3 points to determine exactly the result point position, so we need a system of three equations. The question is: is there some fast way to find out the result coordinates, and there isn’t, is there an algorithm to follow?
edit:
I found the algoritm I was looking for here Trilateration using 3 latitude and longitude points, and 3 distances.
Also a big thanks for @hardmath for the name of method and a wikipedia article.
Restating the problem: You have
ncircles centered atbasePoint[n]with radiusdist[n]which are known to have a single common intersection point. You want to find that one point.Take the first two circles and find their intersection(s). There are either 1 or 2 (or 0, but then the problem has no solution). If 1, that should be the answer. If 2, disambiguate with the next circle. You could proceed to verify that point is on all of the other circles.