I am trying to write the equation of the set of points that has a constant difference in distance from two points (a hyperbola). I would like a general expression, no matter if the line joining the two points is parallel to an axis.

Calling the fixed points A = (a_x, a_y) and B = (b_x, b_y), and a point on the hyperbola P = (p_x, p_y), and the constant distance difference 'c', I started with:

$\displaystyle \sqrt{(a_x - p_x)^2 + (a_y + p_y)^2} - \sqrt{(b_x - p_x)^2 + (b_y + p_y)^2} = c$

$\displaystyle \sqrt{(a_x - p_x)^2 + (a_y + p_y)^2} = \sqrt{(b_x - p_x)^2 + (b_y + p_y)^2} + c$

Squaring both sides:

$\displaystyle (a_x - p_x)^2 + (a_y + p_y)^2 = c^2 + 2c\sqrt{(b_x - p_x)^2 + (b_y + p_y)^2} + (b_x-p_x)^2 + (b_y-p_y)^2$

As you can see, this is quite a mess. I am trying to get it to a more sane "general conic" form like:

$\displaystyle Ax^2 + Bxy + Cy^2 + Dx + Ey + F=0$

but if I square the whole thing again to get rid of the square root on the right, I'll introduce ^4 on the left, which seems like a bad plan. Any clues on where to go from here?

Thanks,

David