I'm trying to find an equation for the ellipse in the form $$Ax^2 + Bxy + Cy^2 +Dx +Ey +F = 0$$ given the foci $(a,b)$ and $(c,d)$ and the sum of focal distances $r$. I started from the definition $$\sqrt{(x-a)^2+(y-b)^2} + \sqrt{(x-c)^2+(y-d)^2} = r$$ squared both sides, moved not radical terms to the right side and squared again and after trudging through a lot of algebra I've arrived at the equation (easier reading of coefficients below)

\begin{align}
0 &= (r^2 + (a-c)^2)x^2 + 2(a-c)(b-d)xy + (r^2 + (b-d)^2)y^2\\
&\qquad + (r^2(a+c) - (a-c)(a^2+b^2-c^2-d^2))x \\
&\qquad +(r^2(b+d) - (b-d)(a^2+b^2-c^2-d^2))y \\
&\qquad+ \frac{1}{4}(r^4 + 2r^2(a^2+b^2+c^2+d^2) + (a^2+b^2-c^2-d^2)^2),
\end{align}

which I want to believe is close, but this does not produce a graph on Desmos. If anyone just has a reference for the equation that I might be able to look at and find my mistakes that would be much appreciated. When I looked on Wikipedia, they talked about using the equation $$\frac{x^2}{a^2}+\frac{y^2}{b^2} = 1 $$ and rotating the major axis, but I have no idea how to translate those coefficients to be in terms of the foci. For easier reading my coefficients are

\begin{align}
A &= r^2+(a-c)^2 \\
B &= 2(a-c)(b-d) \\
C &= r^2 + (b-d)^2 \\
D &= r^2(a+c)-(a-c)(a^2+b^2-c^2-d^2) \\
E &= r^2(b+d)-(b-d)(a^2+b^2-c^2-d^2) \\
F &= \frac{1}{4}(r^4 +2r^2(a^2+b^2+c^2+d^2) + (a^2+b^2-c^2-d^2)^2).
\end{align}

If the middle term of F was $2r^2(a^2+b^2-c^2-d^2)$ I could factor it, but because the left hand side (after the second squaring round) has no $r$ term, there isn't an opportunity for it to change like all the other terms did. Sorry I can't be more specific, but I didn't think typing out the mountain of algebra I've done was a good idea.