使用3个纬度和经度点以及3个距离进行三边测量 [英] Trilateration using 3 latitude and longitude points, and 3 distances

查看:139
本文介绍了使用3个纬度和经度点以及3个距离进行三边测量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

存在未知的目标位置(纬度和经度坐标).我有3个纬度和经度坐标对,每对坐标与目标位置之间的距离以千米为单位.如何计算目标位置的坐标?

There exists an unknown target location (latitude and longitude co-ordinates). I have 3 latitude and longitude co-ordinate pairs and for each pair a distance in kilometers to the target location. How can I calculate the co-ordinates of the target location?

例如,说我有以下数据点

For example, say I have the following data points

37.418436,-121.963477   0.265710701754km
37.417243,-121.961889   0.234592423446km
37.418692,-121.960194   0.0548954278262km

我想要的是将其作为输入并返回37.417959,-121.961954作为输出的函数的内脏是什么?

What I'd like is what would the guts of the function that takes that as input and returns 37.417959,-121.961954 as output look like?

我了解如何计算 http://www.movable-type.co.uk/scripts/latlong.html 我了解一个基本原理,即三个圆圈可以使您得到一个完全重叠的点.我不知道要使用此输入来计算该点的数学运算.

I understand how to calculate the distance between two points, from http://www.movable-type.co.uk/scripts/latlong.html I understand the general principle that with three circles you get exactly one point of overlap. What I'm hazy on is the math needed to calculate that point with this input.

推荐答案

Wikipedia在这里对代数进行了相当详尽的讨论: http://en.wikipedia.org/wiki/Trilateration

Wikipedia gives a pretty thorough discussion of the algebra here: http://en.wikipedia.org/wiki/Trilateration

Wikipedia条目中并未真正涉及的第一步是将纬度/经度坐标转换为笛卡尔坐标:

The first step, not really covered in the Wikipedia entry, is to convert your lat/long coordinates to Cartesian coordinates:

x0 = cos( lon0 ) * cos( lat0 ) , y0 = sin( lon0 ) * cos( lat0 ) , z0 = sin( lat0 )
x1 = cos( lon1 ) * cos( lat0 ) , y1 = sin( lon1 ) * cos( lat1 ) , z1 = sin( lat1 )
x2 = cos( lon2 ) * cos( lat0 ) , y2 = sin( lon2 ) * cos( lat2 ) , z2 = sin( lat2 )

(为使计算简单,我对事情进行了捏造,因此我们以地球半径"而不是公里为单位)

(To keep calculations simple, I've fudged things so we are working in units of "earth radii" instead of kilometers)

为了您的数据,我明白了

For your data, I get

         p0            p1           p2
X   -0.420442596  -0.420430618  -0.42040255
Y   -0.67380418   -0.673826567  -0.673825967
Z    0.607631426   0.607614889   0.607634975

Wikipedia文章中介绍的下一步是简化坐标,方法是平移点,使p0位于原点,然后旋转以使p1位于X轴上,而p2位于XY上飞机.

The next step, which is covered in the Wikipedia article, is to simplify the coordinates, by translating the points so p0 is at the origin, and then rotating so that p1 is on the X axis, and p2 is in the X-Y plane.

对于翻译,只需从p1和p2中减去p0:

For the translation, just subtract p0 from p1 and p2:

    p0a      p1a          p2a
X   0    1.19779E-05   4.00462E-05
Y   0   -2.23864E-05  -2.17865E-05
Z   0   -1.65372E-05   3.5486E-06

轮换并不难. p1b得到(x,y)=(d,0),其中d只是从原点到p1a的距离(毕达哥拉斯定理)

The rotation isn't much harder. p1b gets (x,y) = (d,0), where d is just the distance from the origin to p1a (Pythagorean theorem)

对于p2b,我们需要将p2a分解为两个分量:一个与p1a平行(在x轴上),另一个与p1a垂直(在"b"坐标系中在我们的y轴上).

For p2b, we need to resolve p2a into two components: one parallel to p1a (which goes on our x axis), and one perpendicular to p1a, (which goes on our y axis in the "b" coordinate system).

要做到这一点,我们需要一个在p1a方向上的单位矢量,即p1a *(1/d).取这个单位矢量的点积(如果愿意,称其为p1a_hat)与p2a的乘积,这就是p2b的X坐标. Wikipedia文章将此值称为"I"

To do this, we need a unit vector in the direction of p1a, which is just p1a * ( 1/d ). Take the dot product of this unit vector (call it p1a_hat, if you like) with p2a, and that's the X coordinate for p2b. The Wikipedia article calls this value "I"

现在,Y坐标很容易.在坐标变换下,从原点到p2的长度不能改变.因此,使用勾股定理计算p2a的长度,然后使用勾股定理向后"获得p2b的Y坐标必须保持长度不变.那就是维基百科称为"J"的变量. (请注意,我将让您弄清楚J是正数还是负数.)

Now the Y coordinate is easy. The length from the origin to p2 can't change under the coordinate transformation. So calculate p2a's length using the Pythagorean theorem, then use the Pythagorean theorem "backwards" to get what the Y coordinate for p2b has to be to keep the length the same. That's the variable that Wikipedia calls "J". (Note, there's an ambiguity that I'll leave for you to figure out over whether J is positive or negative).

现在,您已经获得了Wikipedia文章用于计算的三个变量d,I和J.您现在可以乘以地球半径,将其转换回公里.您应该可以从这里进行其余的计算

Now you've got the three variables d, I and J, that the Wikipedia article uses for the calculation. You can convert them back to kilometers now, by multiplying by the earth's radius. You should be able to do the rest of the calculation from here

(顺便说一下,维基百科对坐标变换给出了不同的计算.我想尽可能避免触发).

(Incidentally, Wikipedia gives a different calculation for the coordinate transformation. I like to avoid trig where possible).

这篇关于使用3个纬度和经度点以及3个距离进行三边测量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆