title: Mapping a 2D grid onto a sphere
body: <p>I want to map a grid to a sphere like this:</p>
  
  <p><img src="https://i.stack.imgur.com/8kSYp.jpg" alt="grid to sphere mapping"></p>
  
  <p>In other words, for every point <code>(x, y)</code> ∈[0,1] on the left, I need the <code>(x, y, z)</code> coordinates of the equivalent point on the sphere, between the -45º and +45º meridians on each axis. You can also think of the source coordinates as two angles such that:</p>
  
  <pre><code>phi   = -45º + x * 90º
  theta = -45º + y * 90º
  </code></pre>
  
  <p>The traditional latitude-longitude or polar formulas I've found <a href="https://stackoverflow.com/a/969880/538711">elsewhere</a> are of no use because <a href="https://dl.dropboxusercontent.com/u/1735705/crxcry.jpg" rel="nofollow noreferrer">the results they produce are only distorted along one axis</a>. Any other suggestions?</p>