Fast/smart way to write polar curve in cartesian Is there a fast way to write the curve:
$$r=\frac{a}{1-\frac{1}{\sqrt{2}}\cos(\theta)}$$
as a cartesian curve $f(x,y)=0$?
It seems I can take 
$$r(1-\frac{1}{\sqrt{2}}\cos(\theta)) = a$$
$$r-\frac{x}{\sqrt{2}}=a$$
$$\sqrt{x^2+y^2}-\frac{x}{\sqrt{2}}=a$$
$$x^2+y^2=(a+\frac{x}{\sqrt{2}})^2$$
and then expand out, and complete the square. But I seem to get an error. Perhaps there is a smart way to do this?

\begin{align*}
(a + \frac{x}{\sqrt{2}})^2 = a^2 + ax\sqrt{2} + \frac{x^2}{2}
\end{align*}
And then you can rewrite the equation
\begin{equation*}
\frac{x^2}{2} - ax\sqrt{2} + y^2 = a^2
\end{equation*}
as 
\begin{equation*}
    \left(  \frac{x}{\sqrt{2}} - a \right)^2 + y^2 = \left( \frac{x - a\sqrt{2}}{\sqrt{2}} \right)^2 + y^2 = 2a^2
\end{equation*}
And then you can divide through by $2a^2$ to get the equation for a shifted ellipse:
\begin{equation*}
    \frac{(x-a\sqrt{2})^2}{4a^2} + \frac{y^2}{2a^2} = 1
\end{equation*}
Unfortunately as far as I can tell there is no "smart" way to do it -- it's just crunching numbers.
