Intersection points of an ellipse centered at origin and a circle centered at (X,0)
from sympy import *
init_printing()
x,y,H,W,X,R = symbols('x y H W X R')
Equation of circle of radius R centered at (X,0)
e1 = Eq((x-X)**2 + y**2, R**2)
e1
Equation of ellipse with radius W along x-axis and radius H along y-axis
e2 = Eq((x/W)**2 + (y/H)**2, 1)
e2
Solve for y.
ysq = solve(e2, y**2)[0]
e4 = e1.subs(y**2, ysq)
e4
Expand out into quadratic equation.
e5 = Eq(expand(Add(e4.lhs,-e4.rhs)*H**2*W**2),0)
e5
Has solutions only if...
e6 = Poly(Add(e4.lhs,-e4.rhs)*H**2*W**2,x)
a = e6.coeffs()[0]
b = e6.coeffs()[1]
c = e6.coeffs()[2]
factor(expand(Ge(b**2 -4*a*c,0)))
Solve for points (x,y) which intersect both
simplify(solve((e1,e2), (x,y)))
We can see it gets very complicated, very quickly... :(