title: Convert image in polar to cartesian coordinates
body: <p>I am trying to convert an image in polar to cartesian coordinates.</p>
  
  <p><a href="https://stackoverflow.com/questions/12924598/examples-to-convert-image-to-polar-coordinates-do-it-explicitly-want-a-slick-m">examples to convert image to polar coordinates do it explicitly - want a slick matrix method</a></p>
  
  <p>I thought using the method used above would be a piece of cake but it really isn't!!
  If anyone finds an error into my code please let me know!</p>
  
  <pre><code>phi=(0:.01:1)*2*pi;
  r=0:.01:2;
  
  psi=r&lt;0.5;
  
  
  
  psi_c=cos(phi).'*psi;
  
  [P R z]=find(psi_c);
  L=500;
  
  X=R.*cos(P);
  Y=R.*sin(P);
  
  Xmin=min(X);Xmax=max(X);
  Ymin=min(Y);Ymax=max(Y);
  
  
  F=TriScatteredInterp(X,Y,z);
  
  
  [Xi,Yi]=meshgrid(linspace(-Xmax,Xmax,L),linspace(-Ymax,Ymax,L));
  Zi=F(Xi,Yi);
  </code></pre>
  
  <p>What I find very odd is the fact that when I change phi, it makes radical changes and not in the way I expect!</p>
  
  <p>Cheers!</p>