I'm trying to find the intersection points of circle and conic section curve. So, I'm solving the system of equations:
$$ \begin{cases}Ax^2 + Bxy + Cy^2 + Dx + Ey + F = 0 \\ (x - x_0)^2 + (y - y_0)^2 = R^2 \end{cases} $$
From the second equation I can find that $x = x_0 \pm \sqrt{R^2 - (y - y_0)^2}$
Then I put it to the first equation and getting coefficients of quartic equation $ax^4 + bx^3 + cx^2 + dx + e = 0$ which must give me the $y$ roots:
Substitutions for simplicity:
$ \alpha = 2Ax_0 + D \\ \beta = A - C \\ \gamma = -(2Ay_0 + Bx_0 + E) \\ \delta = A(y_0^2 - x_0^2 - R^2) - Dx_0 - F \\ \epsilon = R^2 - y_0^2$
Coefficients of quartic equation:
$ a = \beta^2 + B^2 \\ b = 2(\beta\gamma + B\alpha - B^2y_0) \\ c = 2\beta\delta + \gamma^2 - B^2\epsilon + \alpha^2 - 4B\alpha y_0 \\ d = 2(\gamma\delta - B\alpha\epsilon - \alpha^2y_0) \\ e = \delta^2 - \alpha^2\epsilon $
In most cases the solving of this equation gives me a two real and two complex roots. I skip the complex roots and put the real into the equation of x. But it leads me to the complex x roots.
Did I made mistake in my calculations of a,b,c,d,e of quartic equation? Or am I trying to solve it in the wrong way?
I tried to solve it few times and got the same coefficients each time.