distance to conic from origin optimization

104 Views Asked by At

I want to optimize the distance from the origin to a generalized conic function (optimize for min/max distance).

What I have so far: $$ A>0, B^2<AC$$ Conic equation: $$Ax^2 + 2Bxy + Cy^2 = 1,$$ distance equation: $$(x^2 + y^2)^{1/2}.$$ Since it will make math easier and won't matter for distance, I thought to do distance squared, so optimizing $$d^2=(x^2 + y^2).$$

Using Lagrange method:

$$F(x,y,s)=x^2 + y^2 + s(Ax^2 + 2Bxy + Cy^2 - 1)$$ $$\nabla F(x,y,s)=(\partial F/\partial x, \partial F/\partial y,\partial F/\partial s)=(0,0,0)$$ for optimization

$$ \begin{align} \partial F/\partial x & = 0 = 2x + 2Asx + 2Bsy \\ \partial F/\partial y & = 0 = 2y + 2Csy + 2Bsx \\ \partial F/\partial s & = 0 = Ax^2 + 2Bxy + Cy^2 - 1 \end{align} $$

I can get here, I just can't do the algebra to solve it, and if I try using an online source, it doesn't have enough computing power for free users, I figure there is some trick to do, but I can't for the life of me find it. Thank you all.