Generating a Conic Section From 5 Points I'm trying to generate a round trailing edge for an airfoil with either no trailing edge or a sharp trailing edge. I do this by chopping off the end of the airfoil, taking 2 points each from the upper and lower sides, and then using this with the location of the trailing edge (1,0 usually) to generate a conic section in the form of Ax^2 + Bxy + Cx^2 + Dx + Ey + F = 0.
Then, I generate some x values and the corresponding y values from WolframAlpha's Solution. This works very well for some airfoils - but for some the contents of the square root are negative for some x values. How can I handle this? Does anyone understand how WolframAlpha solved the equation for y?
 A: My guess is that you need to match three points and two slopes at the trailing edge of the airfoil. When you have 5 points a sudden change of direction for streamline may be undesirable.
For 5 point solution the solution with 5 simultaneous linear equations and 5 unknowns is straightforward.
$  A x_1^2 + B x_1y_1 + C y_1^2 + D x_1 + E y_1 + F = 0, $
$ A x_2^2 + B x_2y_2 + C y_2^2 + D x_2 + E y_2 + F = 0,$
....
and
$ A x_5^2 + B x_5y_5 + Cy_5^2 + D x_5 + E y_5 + F = 0.$
which can be solved by Cramer's Rule and determinants.
The procedure can accomodate slope matching as well.
A: 
but for some the contents of the square root are negative for some x values. How can I handle this?

Use complex numbers.

Does anyone understand how WolframAlpha solved the equation for y?

For Quadratic Equations (herein $y$), there is a predetermined formula
Both can be easily read up on Wikipedia.
A: Most of the time, the conic is an ellipse or a hyperbola.  In the ellipse, and sometimes in the hyperbola, there are $x$-values with no real $y$-values, as you found.  A vertical line misses the curve altogether.
If it is near the trailing edge, I think it means that you have reached the end of the wing because it was rounded off.  So getting no real $y$ beyond that is a good thing.  If it is some distance away, it might be you have reached the other end of the ellipse.  That is less good because it happens where the wing should be getting thicker, but you should be able to spot that.
