使用未知固定点的给定距离进行 3D 三边测量
我是这个论坛的新手,不是一个以英语为母语的人,所以请友善! :)
这是我目前面临的挑战: 我想根据 2 点之间的一组给定距离计算 3D 欧几里德空间中未知点的(近似)相对坐标。 在我的第一种方法中,我想忽略可能的多个解决方案,只是随机采用第一个解决方案。
例如: 给定的一组距离:(我认为它创建了一个以直角三角形为基础的金字塔)
P1-P2-距离
- 1-2-30
- 2-3-40
- 1-3-50
- 1-4-60
- 2-4 -60
- 3-4-60
第 1 步: 现在,如何计算这些点的相对坐标?
我认为第一个点为 0,0,0,所以第二个点为 30,0,0。
之后,可以通过找到点 1 和 2 的 2 个圆的交点以及它们到点 3 的距离(分别为 50 和 40)来计算第三个点。我如何从数学上做到这一点? (尽管我用这些简单的数字来简单地表示我脑海中的情况)。此外,我不知道如何以正确的数学方式得到答案,第三点位于 30,40,0(或 30,0,40,但我会忽略它)。
但获得第四点却没有那么容易。我认为我必须使用 3 个球体来计算交叉点才能得到该点,但我该怎么做呢?
第2步: 在我弄清楚如何计算这个“简单”示例之后,我想使用更多未知点...对于每个点,到另一个点的最小给定距离为 1,以将其“链接”到其他点。如果坐标由于其自由度而无法计算,我想忽略所有可能性,除了我随机选择的一种,但相对于已知距离。
第三步: 现在最后阶段应该是这样的:由于现实生活中的情况,每个测量的距离都有点不正确。因此,如果给定点对的距离超过 1 个,则对距离进行平均。但由于距离不精确,确定点的确切(相对)位置可能会很困难。所以我想将不同的可能位置平均到“最佳”位置。
你能帮助我一步步完成我的挑战吗?
I am new to this forum and not a native english speaker, so please be nice! :)
Here is the challenge I face at the moment:
I want to calculate the (approximate) relative coordinates of yet unknown points in a 3D euclidean space based on a set of given distances between 2 points.
In my first approach I want to ignore possible multiple solutions, just taking the first one by random.
e.g.:
given set of distances: (I think its creating a pyramid with a right-angled triangle as a base)
P1-P2-Distance
- 1-2-30
- 2-3-40
- 1-3-50
- 1-4-60
- 2-4-60
- 3-4-60
Step1:
Now, how do I calculate the relative coordinates for those points?
I figured that the first point goes to 0,0,0 so the second one is 30,0,0.
After that the third points can be calculated by finding the crossing of the 2 circles from points 1 and 2 with their distances to point 3 (50 and 40 respectively). How do I do that mathematically? (though I took these simple numbers for an easy representation of the situation in my mind). Besides I do not know how to get to the answer in a correct mathematical way the third point is at 30,40,0 (or 30,0,40 but i will ignore that).
But getting the fourth point is not as easy as that. I thought I have to use 3 spheres in calculate the crossing to get the point, but how do I do that?
Step2:
After I figured out how to calculate this "simple" example I want to use more unknown points... For each point there is minimum 1 given distance to another point to "link" it to the others. If the coords can not be calculated because of its degrees of freedom I want to ignore all possibilities except one I choose randomly, but with respect to the known distances.
Step3:
Now the final stage should be this: Each measured distance is a bit incorrect due to real life situation. So if there are more then 1 distances for a given pair of points the distances are averaged. But due to the imprecise distances there can be a difficulty when determining the exact (relative) location of a point. So I want to average the different possible locations to the "optimal" one.
Can you help me going through my challenge step by step?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要使用三角学 - 具体来说,是“余弦规则”。这将为您提供三角形的角度,从而让您解决第三点和第四点。
规则规定,
其中 a、b 和 c 是边的长度,C 是与边 c 相对的角度。
在您的例子中,我们需要 1-2 和 1-3 之间的角度 - 两条线在 (0,0,0) 处交叉的角度。它将是 90 度,因为您有 3-4-5 三角形,但让我们证明:
这是线 (0,0,0)-(30,0,0) 和 (0,0,0 )- 第 3 点;沿该线延伸边 1-3 的长度(即 50),您将得到第二个点 (0,50,0)。
找到第四点有点棘手。我能想到的最简单的算法是首先找到点的 (x,y) 分量,然后使用毕达哥拉斯的 z 分量很简单。
考虑 (x,y,0) 平面上有一个点位于点 4 的正下方 - 将此点称为 5。您现在可以创建 3 个直角三角形 1-5-4、2-5- 4、和3-5-4。
你知道 1-4、2-4 和 3-4 的长度。因为它们是直角三角形,所以比率
1-4 : 2-4 : 3-4
等于1-5 : 2-5 : 3-5
。使用三角方法找到点 5 - “正弦规则”将为您提供 1-2 和 1-2 之间的角度。 1-4、2-1 和 2-4 等。“正弦规则”规定(在直角三角形中)
因此,对于三角形 1-2-4,尽管您不知道长度 1-4 和 2-4,你确实知道比例
1-4 : 2-4
。同样,您也知道其他三角形中的比率2-4 : 3-4
和1-4 : 3-4
。我会让你去解决第 4 点。一旦你有了这一点,你就可以使用毕达哥拉斯轻松地解决 4 的 z 分量 - 你将得到边 1-4、1-5,长度 4-5 将是z 分量。
You need to use trigonometry - specifically, the 'cosine rule'. This will give you the angles of the triangle, which lets you solve the 3rd and 4th points.
The rules states that
where a, b and c are the lengths of the sides, and C is the angle opposite side c.
In your case, we want the angle between 1-2 and 1-3 - the angle between the two lines crossing at (0,0,0). It's going to be 90 degrees because you have the 3-4-5 triangle, but let's prove:
This is the angle between the lines (0,0,0)-(30,0,0) and (0,0,0)- point 3; extend along that line the length of side 1-3 (which is 50) and you'll get your second point (0,50,0).
Finding your 4th point is slightly trickier. The most straightforward algorithm that I can think of is to firstly find the (x,y) component of the point, and from there the z component is straightforward using Pythagoras'.
Consider that there is a point on the (x,y,0) plane which sits directly 'below' your point 4 - call this point 5. You can now create 3 right-angled triangles 1-5-4, 2-5-4, and 3-5-4.
You know the lengths of 1-4, 2-4 and 3-4. Because these are right triangles, the ratio
1-4 : 2-4 : 3-4
is equal to1-5 : 2-5 : 3-5
. Find the point 5 using trigonometric methods - the 'sine rule' will give you the angles between 1-2 & 1-4, 2-1 and 2-4 etc.The 'sine rule' states that (in a right triangle)
So for triangle 1-2-4, although you don't know lengths 1-4 and 2-4, you do know the ratio
1-4 : 2-4
. Similarly you know the ratios2-4 : 3-4
and1-4 : 3-4
in the other triangles.I'll leave you to solve point 4. Once you have this point, you can easily solve the z component of 4 using pythagoras' - you'll have the sides 1-4, 1-5 and the length 4-5 will be the z component.
我最初假设您知道所有点对之间的距离。
正如您所说,您可以选择一个点 (
A
) 作为原点,沿 x 轴定向第二个点 (B
),然后放置第三个点 (< code>C) 沿 xy 平面。您可以按如下方式求解 C 的坐标:为了使其准确工作,您需要避免点
{A,B,C}
位于一条直线或接近该直线的情况。求解 3 空间中的其他点是类似的 - 您可以扩展距离的毕达哥拉斯公式,取消二次元,并求解所得的线性系统。但是,这并不能直接帮助您完成步骤 2 和 3...
不幸的是,我也不知道步骤 2 和 3 的良好精确解决方案。您的总体问题通常是过度约束(由于冲突的噪声距离)和约束不足(由于缺少距离)。
您可以尝试迭代求解器:从所有点的随机放置开始,将当前距离与给定距离进行比较,然后使用它来调整您的点以改进匹配。这是一种优化技术,所以我会查找有关数值优化的书籍。
I'll initially assume you know the distances between all pairs of points.
As you say, you can choose one point (
A
) as the origin, orient a second point (B
) along the x-axis, and place a third point (C
) along the xy-plane. You can solve for the coordinates of C as follows:For this to work accurately, you will want to avoid cases where the points
{A,B,C}
are in a straight line, or close to it.Solving for additional points in 3-space is similar -- you can expand the Pythagorean formula for the distance, cancel the quadratic elements, and solve the resulting linear system. However, this does not directly help you with your steps 2 and 3...
Unfortunately, I don't know a well-behaved exact solution for steps 2 and 3, either. Your overall problem will generally be both over-constrained (due to conflicting noisy distances) and under-constrained (due to missing distances).
You could try an iterative solver: start with a random placement of all your points, compare the current distances with the given ones, and use that to adjust your points in such a way as to improve the match. This is an optimization technique, so I would look up books on numerical optimization.
如果您知道节点(系统的固定部分)之间的距离以及到标签(移动)的距离,您可以使用三边测量来找到 x,y 位置。
我使用具有测距功能的 Nanotron 无线电模块来完成此操作。
If you know the distance between the nodes (fixed part of system) and the distance to the tag (mobile) you can use trilateration to find the x,y postion.
I have done this using the Nanotron radio modules which have a ranging capability.