圆周相交算法
我有一个点数组,其中(点)我知道坐标(在我的坐标平面中,x/y)。然后我有一个未知坐标的点,但我知道从“已知”点到该点的距离。我正在寻找“未知”点坐标。应该是一种三角测量。
我考虑过用方程组来描述这种情况。
假设这个数据:
coord[n] basePoints;
double[n] dist;
coord result;
让坐标像 a:
struct {
double x,y;
};
现在,圆周方程是:
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]
在这种情况下,我们需要 3 个点来精确确定结果点位置,因此我们需要一个由三个方程组成的系统。问题是:是否有一些快速的方法来找出结果坐标,但没有,是否有可遵循的算法?
编辑:
我在这里找到了我正在寻找的算法使用 3 个纬度和经度点以及 3 个距离进行三边测量。
还要非常感谢 @hardmath 提供的方法名称和维基百科文章。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
重述问题:您有以
basePoint[n]
为中心、半径为dist[n]
的n
个圆,已知这些圆有一个公共交点观点。你想找到这一点。取前两个圆并找到它们的交点。要么是 1,要么是 2(或者是 0,但问题无解)。如果是1,这应该就是答案。如果为 2,则与下一个圆圈消除歧义。您可以继续验证该点是否位于所有其他圆上。
Restating the problem: You have
n
circles 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.
首先,你说你有n个点的坐标,以及到另一个点的距离(所以n个距离)。
如果你只有 2 个点的坐标,并且这 2 个坐标和第三个点(未知)之间的距离为 X(x,y)。
假设你的第一个点是 A(x1,y1),第二个点是 B(x2,y2)
现在你想找到未知点 X(x,y)
得到 A 和 x 之间的距离
你可以像这样 知道 x1、y1 和 d
,类似地,B 和 X 之间的距离将
通过这两个方程得到,您将得到 2 个带有 2 个此类未知变量的线性方程,
您可以求解这两个方程以获得点的 x 和 y 坐标X(x,y)。
您没有提到您正在使用什么编程语言,但您可以使用您选择的任何编程语言来实现这一点。
你不需要n个点和n个距离来计算未知点,你可以只用2个点来计算它。
First of all, you say you have coordinates of n points, and the distance to the another point(so n distances).
if you have coordinates of only 2 points and you have the distance between those 2 coordinates and a third point(unknown) say X(x,y).
Lets say your first point is A(x1,y1) and your second Point is B(x2,y2)
Now you want to find the unknown Point X(x,y)
you can get distance between A and x like this
here you already know x1, y1 and d
and similarly distance between B and X will be
so by these 2 equations, you will get 2 linear equations with 2 unknown variables of this type
you can solve these two equations to get x and y coordinates of point X(x,y).
you have not mentioned what programming language you are using, but you can implement this using any programming language of your choice.
You dont need n points and n distances to calculate the unknown point, you can calculate it using just 2 points.