10

我有一组 2d 网格点 (x,y),我想将它们作为 3d 点 (x,y,z) 映射/投影到球体上。

我意识到随着 abs(y) 的增加,两极会有一些翘曲,但我的网格补丁只会覆盖赤道附近球体的一部分,因此可以避免严重的翘曲。

我很难找到正确的方程式。

4

3 回答 3

22

从关于墨卡托投影的维基百科文章中转述:

Given a "mapping sphere" of radius R,
the Mercator projection (x,y) of a given latitude and longitude is:
   x = R * longitude
   y = R * log( tan( (latitude + pi/2)/2 ) )

and the inverse mapping of a given map location (x,y) is:
  longitude = x / R
  latitude = 2 * atan(exp(y/R)) - pi/2

要从逆映射的结果中获取 3D 坐标:

Given longitude and latitude on a sphere of radius S,
the 3D coordinates P = (P.x, P.y, P.z) are:
  P.x = S * cos(latitude) * cos(longitude)
  P.y = S * cos(latitude) * sin(longitude)
  P.z = S * sin(latitude)

(请注意,“地图半径”和“3D 半径”几乎肯定会有不同的值,所以我使用了不同的变量名。)

于 2012-10-04T19:30:31.960 回答
2

我想你在球体上的 (x,y) 是纬度,经度。

如果是这样,请参阅http://tutorial.math.lamar.edu/Classes/CalcII/SphericalCoords.aspx

在此处输入图像描述

那里:

phi = 90 度 - 纬度

theta = 经度

rho = 球体的半径。

于 2012-10-04T20:25:17.933 回答
1

我希望您可以使用许多全球投影的倒数。

与其他投影相比,赤道附近的墨卡托非常好。

公式在 wiki 页面上。
http://en.wikipedia.org/wiki/Mercator_projection

于 2012-10-04T17:37:19.470 回答