Mapping from a rect onto a sphere

On 14/09/2015 at 08:11, xxxxxxxx wrote:

I want to calculate myself how to map (project) onto a sphere.
Below pictures show the input if we want a circle on the sphere.

The question is how to calculate the required input to get a circle on the sphere?

I know of the different projection (spherical to rectangular for example), but I want the output to be spherical. So what should be the input and the projection?

The idea behind it, is to paint on a layer and project it on a sphere (with of course the correct projection).
You can do it with the c4d tools, but I like to do it myself.