Calculate uv coordinates from spherical coordinates

@Federico_Toledo
What result do you get? And what is expected result? Any pictures?
Maybe would be better to provide an editable live code example? jsfiddle, codepen, codesandbox etc.

PS A sphere of evenly distributed elements with UV coords: