title: Level sets of a maths function in Python
body: <p>Given a function </p>
  
  <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><em>f(x, y): &#8477;<sup>2</sup> → &#8477;</em></strong> </p>
  
  <p>I want to use Python to find its level sets, that is, <strong><em>f<sup>&nbsp;-1</sup>(c)</em></strong> for a fixed <strong><em>c</em></strong>.</p>
  
  <p>More generally it would also be helpful to find the set <strong><em>{&nbsp;(x, y): a &lt; f(x, y) &lt; b&nbsp;}</em></strong> for fixed <strong><em>a, b</em></strong>.</p>
  
  <p>Is there a function in a library that does this reasonably fast?</p>
  
  <p>P.S. Raising awareness to <a href="https://meta.stackexchange.com/questions/4152/adding-support-for-math-notation">the request of having math rendering in stackoverflow</a>, which would be useful for this question.</p>