title: How do you map a point(x,y) on a 2D image to 3D space? (illustration provided)
body: <p>I have a stack of images (about 180 of them) and there are 2 stars <strong>(just basic annotations)</strong> on every single image. Hence, the position (x,y) of the two stars are provided initially. The dimensions of all these images are fixed and constant.</p>
  
  <p>The 'distance' between the image is about 1<sup>o</sup> with the origin to be the center (width/2, height/2) of every single 2D image. Note that, if this is plotted out and interpolated nicely, the stars would actually form a <strong>ring</strong> of an <em>irregular</em> shape.  </p>
  
  <p><img src="https://i.stack.imgur.com/JiuAE.png" alt="Enter image description here"></p>
  
  <p><em>The dotted red circle and dotted purple circle are there to give a stronger scent of a 3D space and the arrangement of the 2D images (like a fan). It also indicates that each slice is about  1<sup>o</sup> apart</em>.</p>
  
  <ol>
  <li><p>With the provided (x,y) that appeared in the 2D image, how do you get the corresponding (x,y,z) in the 3d space knowing that each image is about 1<sup>o</sup> apart?</p></li>
  <li><p>I know that MATLAB had 3D plotting capabilities, how should I go about implementing the solution to the above scenario? (Unfortunately, I have very little experience plotting 3D with MATLAB)</p></li>
  </ol>
  
  <p><strong>SOLUTION</strong></p>
  
  <p>Based on the accepted answer, I looked up a bit further: spherical coordinate system. Based on the computation of phi, rho and theta, I could reconstruct the ring without problems. Hopefully this helps anyone with similar problems.</p>
  
  <p>I have also documented the solution here. I hope it helps someone out there, too: 
  <a href="http://gray-suit.blogspot.com/2011/07/spherical-coordinate-system.html" rel="nofollow noreferrer">http://gray-suit.blogspot.com/2011/07/spherical-coordinate-system.html</a></p>