M HYPE SPLASH
// general

Circle Least Squares Fit

By Emily Wilson
$\begingroup$

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?

$\endgroup$ 1

2 Answers

$\begingroup$

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

$\endgroup$ 2 $\begingroup$

It is true that the given equation $Ac = B$ has no solution. That is why we are trying to get an approximate answer (least-squares fit).

An explanation on Khan Academywill give you an understanding of the result after approximating it. If we cannot find the solution to $Ac = B$, we find solution to $A^TAc=A^TB$. This equation is the connection missing.

$\endgroup$

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy