I have a planar mesh of hexagons (or any other shape) that I want to bend into the shape of a half-sphere. For this purpose I want to loop through each vertice in my mesh and find the proper z coordinate. Therefore I need a function that given the $x$ and $y$ coordinates will give me the z coordinate so that the result is a sphere plot.
I have done all the math and from various different starting points I always end up with the function as follows:
$$z = \cos(a\sin y)*\cos(a\sin x)$$
However, the result just does not look like a sphere at all. You can verify this on livephysics.com or see my result rendering in povray. (Please note that the rendering does not use orthographic perspective which is why the mesh appears do be wider than the sphere in the top view rendering.)
I need a function that will have a perfect half-sphere, what am I doing wrong?