Like a map of 2d grid points (x, y) onto a sphere in the form of three-dimensional points (x, y, z)

I have a set of 2d grid points (x, y) that I want to display / project onto a sphere as three-dimensional points (x, y, z).

I understand that there will be some kind of pole deformation as abs (y) increases, but my mesh patch will cover only part of the sphere near the equator, so serious deformation will be prevented.

I am having trouble finding the right equations for this.

+7
source share
3 answers

Paraphrased from a 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 3D coordinates from the inverse mapping result:

 Given longitude and latitude on a sphere of radius S, the 3D coordinates P = (Px, Py, Pz) are: Px = S * cos(latitude) * cos(longitude) Py = S * cos(latitude) * sin(longitude) Pz = S * sin(latitude) 

(Note that “map radius” and “three-dimensional radius” will almost certainly have different meanings, so I used different variable names.)

+16
source

I would expect that you can use the inverse of any of several globe projections.

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

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

+1
source

I believe that your (x, y) on the sphere is latitude, longitude.

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

enter image description here

There:

phi = 90 degrees latitude

theta = longitude

rho = radius of your sphere.

+1
source

All Articles