I am trying a derivation of the polar form of an ellipse using vector notation. Beginning with a definition of an ellipse as the set of points in $\vec{R}^2$ for which the sum of the distances from two points is constant, I have $|\vec{r_1}|+|\vec{r_2}| = c$
Thus, $|\vec{r_1}|^2+|\vec{r_1}||\vec{r_2}|=c|\vec{r_1}|$
ellipse diagram, Inductiveload on Wikimedia
Choosing a coordinate system (similar to the one in the diagram), such that $\vec{r_1}=\vec{r}=x\vec{i}+y\vec{j}$, and $\vec{r_2}=\vec{F_2 P}=(x-a)\vec{i}+y\vec{j}$
Noticing that $|\vec{r_1}||\vec{r_2}|=\frac{\vec{r_1}\cdot\vec{r_2}}{\cos(\theta)}=\frac{x^2-ax+y^2}{\cos(\theta)}=\frac{r^2-ax}{\cos(\theta)}$
and using $x=r\cos(\theta)$, we get
$r^2+\frac{r^2}{\cos(\theta)}-ar=cr$, thus I get a polar equation for an ellipse of $r=\frac{a+c}{1+\sec(\theta)}$
whereas I expect $r=\frac{a(1-e^2)}{1+e\cos(\theta)}$. Please tell me where this argument takes the wrong turn!