How to do a 2d quadratic fit in C++? : <p>How would you perform a 2d quadratic fit in C++?  The equation to fit is of the form:</p>

<pre><code>f(x, y) = a*x^2 + b*x*y + c*y^2 + d*x + e*y + f
</code></pre>

<p>where a, b, c, d, e and f are the fit parameters. Is it straightforward to write? Is there a library that is free to use for that?</p>
