我想把GPS的位置(纬度,经度)转换成x,y坐标。我找到了许多关于这个主题的链接,并应用了它,但它没有给我正确的答案!
我遵循以下步骤来测试答案:(1)首先,我采取两个位置,并使用地图计算它们之间的距离。(2)然后将两个位置转换为x,y坐标。(3)然后再次计算x,y坐标中两点之间的距离,看看它是否在点(1)中给出了相同的结果。
我找到了下面的解决方案之一,但它没有给我正确的答案!
latitude = Math.PI * latitude / 180;
longitude = Math.PI * longitude / 180;
// adjust position by radians
latitude -= 1.570795765134; // subtract 90 degrees (in radians)
// and switch z and y
xPos = (app.radius) * Math.sin(latitude) * Math.cos(longitude);
zPos = (app.radius) * Math.sin(latitude) * Math.sin(longitude);
yPos = (app.radius) * Math.cos(latitude);
我也尝试了这个link,但仍然不能很好地与我一起工作!
如何将(纬度,经度)转换为(x,y)?
谢谢,
https://stackoverflow.com/questions/16266809
复制相似问题