<s>[INST] Ellipse equations paradox We know that an ellipse can be plotted in cartesian coordinates using the following parametric function:
$$ ellipsePoint(\theta)=\left[\begin{array}{c}a \cdot \cos(\theta)\\b \cdot \sin(\theta)\end{array}\right], 0\leqslant \theta \lt 2\pi $$
I have rewritten it as an equation in polar coordinates:
$$ r=distance(ellipsePoint(\theta), \left[\begin{array}{c}0\\0\end{array}\right])=distance(\left[\begin{array}{c}a \cdot \cos(\theta)\\b \cdot \sin(\theta)\end{array}\right], \left[\begin{array}{c}0\\0\end{array}\right])=\sqrt{a^2 \cdot \cos(\theta)^2+b^2 \cdot \sin(\theta)^2} $$
However, plotting values of the $ ellipsePoint $ function and plotting the solutions of the second equation result in different graphs:

Why is it so? Have I done something incorrectly?
 [/INST] Switching to polar coordinates,
$$\rho=\sqrt{a^2\cos^2t+b^2\sin^2t},\\\tan\theta=\frac ba\tan t.$$
After elimination of $t$,
$$\rho=\sqrt{a^2\cos^2\left(\arctan\left(\frac ab\tan\theta\right)\right)+b^2\sin^2\left(\arctan\left(\frac ab\tan\theta\right)\right)}
\\=\sqrt{a^2\frac1{\dfrac{a^2}{b^2}\tan^2\theta+1}+b^2\frac{\dfrac{a^2}{b^2}\tan^2\theta}{\dfrac{a^2}{b^2}\tan^2\theta+1}}
\\=\sqrt{\frac{a^2b^2}{a^2\sin^2\theta+b^2\cos^2\theta}}
.$$
Note that with $a=b=r$, this simplifies to $r$, as expected. The values at multiples of $\dfrac\pi2$ are also correct.
</s>