The formula for calculating the center of mass is
$$ r_{center} = \frac{m_1 \cdot r_1 + m_2 \cdot r_2}{m_1+m_2} $$
Why can't I use it to calculate the barycentre of two planets?
I understand how to use ratios to approach this problem.
$$ \frac{r_1}{r_2} = \frac{m_1}{m_2} $$ $$ r_1 = \frac{m_2}{m_1+m_2}\cdot (d_{Sun->Earth}) $$
However, I do not understand why I can not use the $r_{center}$ formula.