how map 2d grid points (x,y) onto sphere as 3d points (x,y,z)

浪子不回头ぞ 提交于 2019-11-27 01:46:49

Paraphrased from the wikipedia article on Mercator projection:

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

To get the 3D coordinates from the result of the inverse mapping:

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)

(Note that the "map radius" and the "3D radius" will almost certainly have different values, so I have used different variable names.)

I suppose that your (x,y) on the sphere are latitude, longitude.

If so, see http://tutorial.math.lamar.edu/Classes/CalcII/SphericalCoords.aspx.

There:

phi = 90 degree - latitude

theta = longitude

rho = radius of your sphere.

I would expect that you could use the inverse of any of a number of globe projections.

Mercator is pretty good around the equator compared to other projections.

Formulas are on the wiki page.
http://en.wikipedia.org/wiki/Mercator_projection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!