[Math] Circle Least Squares Fit

linear algebramatrices

So my question is this:
Find the equation of the circle that gives the best least squares circle fit to the points $(-1,-2), (0,2.4), (1.1,-4),$ and $(2.4,-1.6).$

So far I have this general equation:
$2xc_1+2yc_2+(r^2-c_1^2-c_2^2)=x^2+y^2$ where $r^2-c_1^2-c_2^2 = c_3$

So then I think I create matrix:
$\begin{pmatrix} 2x_1 & 2y_1 & 1 \\ . & . & . \\ 2x_n & 2y_n & 1 \end{pmatrix} \begin{pmatrix} c_1 \\ c_2 \\ c_3\end{pmatrix} – \begin{pmatrix} x_1^2+y_1^2 \\ … \\ x_n^2+y_n^2\end{pmatrix}$

and after replacing $x_1 = -1$ and $y_1 = -2$ until $x_4$ and $y_4$, I have this matrix:
$\begin{pmatrix} -2 & -4 & 1 \\ 0 & 4.8 & 1 \\ 2.2 & -8 & 1 \\ 4.8 & -3.2 & 1 \end{pmatrix} \begin{pmatrix} c_1 \\ c_2 \\ c_3\end{pmatrix} – \begin{pmatrix} 5 \\ 5.76 \\ 17.21 \\ 8.32\end{pmatrix}$

Which i guess I try to solve by setting equal to 0, then moving the last matrix to the other side and make it look like this:
$\begin{pmatrix} -2 & -4 & 1 \\ 0 & 4.8 & 1 \\ 2.2 & -8 & 1 \\ 4.8 & -3.2 & 1 \end{pmatrix} \begin{pmatrix} c_1 \\ c_2 \\ c_3\end{pmatrix} = \begin{pmatrix} 5 \\ 5.76 \\ 17.21 \\ 8.32\end{pmatrix}$

And finally solve for $c_1$, $c_2$, $c_3$. But this system has no solution as shown here. Am I missing something huge here or what am I doing wrong?

Best Answer

Just multiply both sides of the equation by $A^{T}\,,$ where $A$ is your matrix, and then solve the resulting system.

Related Question