Hello. I wonder could anyone help me with the following.

All conic sections can be represented by the equation:

Let's start with the parabola. This is the curve comprised of the locus of points whose distance to a line ax+by+c=0 (the directorix) is always the same as their distance to a point (u,v) (the focus).

So, given the directorix and the focus can one derive the general form given above for that particular parabola?

Yes. One can equate the distance of the general point (x,y) from the directorix and the focus like so:

Now one just moves everything to the left hand side, collects up terms in x^2,y^2,xy,x and y and obtains the results:

Good. So given u,v,a,b,c as input, one can calculate A,B,C,D,E and F as output.

How about the inverse. Given a general conic (A,B,C,D,E,F)

known the be a parabola, can one find the focus and directorix.

Yes. From the first two equations above, we have:

Now this alone is not sufficient to determine a and b, as each square root may be either positive or negative, but we also have the third equation above. So if we calculate the positive roots and then find that -2ab is not equal to C then we can choose either a or b and reverse its sign and we are done. So we now know a and b. The remaining equations give as c,u and v as:

Job done.

My question is, how about the hyperbola and the ellipse. Can we do the same thing?

Let's just consider the hyperbola.

The first part is easy enough. Given the foci ( two of them obviously, (a,b) and (c,d) ) of the hyperbola we can set the difference of the distances from the general point (x,y) on the hyperbola to these foci to be a constant (say k) to obtain:

Now again, we collect powers of x and y etc. and after the dust has settled we obtain:

This all works perfectly well. I've written code to allow me to move the mouse around on the screen to define the position of the second focus given the first and the hyperbola is drawn from the calculated values of A,B,C,D,E and F and all is well.

BUT, how about obtaining a,c,b,d from A,B,C,D,E and F. That looks hard to me.

As you can see, I've been pleasantly busy. So after all this my question is:

Given the general equation of a hyperbola or ellipse. How to find the foci?

I have solved the problem fully for the parabola as you see above. But only half the problem for the hyperbola and ellipse (i.e. given the foci I can obtain the general equation).

Thanks for any suggestions. There may be a much simpler approach which I am missing.