Assume $a>0, b>0$.
If $a=b$ it is straightforward to see that the orbit is a circle with radius $a$, so suppose $a \ne b$.
The constraint for the elliptical orbit is $g(x,y) = ({x \over a})^2 + ({y \over b})^2 =1$.
The distance is $f(x,y) = \sqrt{x^2+y^2}$. It is equivalent and more convenience to minimize the square of the distance $s(x,y) = f(x,y)^2$.
Note that $E = \{ (x,y) | ({x \over a})^2 + ({y \over b})^2 =1 \}$ is compact, hence a minimum and maximum exists. Also, $Dg((x,y)) \neq 0$ for all $(x,y) \in E$, so we can use the Lagrange theorem to characterize the extrema.
Then $D s((x,y))+ \lambda Dg ((x,y)) = 0$, which yields
$2x(1+ \lambda {1 \over a^2}) = 0$, $2y(1+ \lambda {1 \over b^2}) = 0$.
The solutions to the Lagrange equation are (1) $(x,y) = 0$, (2) $x$ arbitrary, $\lambda = -a^2$, $y=0$ and (3) $y$ arbitrary, $\lambda = -b^2$, $x=0$. Since we must also satisfy the constraint $g(x,y) = 1$, we are left with
$x=\pm a$, $y = 0$ and $x=0$, $y = \pm b$. Since the distance is insensitive to sign, we see that one solution (ignoring sign) must be the minimum and the other the maximum, and the corresponding distances are $a,b$ which are half the
lengths of the major and minor axes.