title: Visualizing a toroidal surface in Matlab
body: <p>I have a problem which is twofold:</p>
  
  <ol>
  <li><p>How do I plot a toroidal surface in MATLAB, given a major radius <em>R</em> and a minor radius <em>a</em>? To avoid confusion, it is the <a href="http://en.wikipedia.org/wiki/Toroidal_and_poloidal" rel="noreferrer">toroidal/poloidal coordinate system</a>, illustrated in the picture below, that I'm talking about. <img src="https://i.stack.imgur.com/SIcS2.png" alt="Toroidal coordinate system"></p></li>
  <li><p>Now, in any point <em>(phi, theta)</em> on this surface, the minor radius will be distorted by some value that I have stored in a matrix. How do I plot this distorted surface? This might be easy once I have the answer to part 1, but this is my actual goal, so any solution to part 1 that cannot handle this is pretty useless to me.</p></li>
  </ol>
  
  <p><sub>If anyone can tell me how to make the image appear smaller here, please do =)</sub></p>