Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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?

share|improve this question
    
Already, you have asked to find the best least square fit. So, what you have is an overdetermined system. –  Mhenni Benghorbal Oct 16 '12 at 5:09

1 Answer 1

up vote 2 down vote accepted

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

share|improve this answer
    
@MhnenniBenghorbal I actually just figured it out on my own but yep that is how to do it. Thanks –  Charlie Yabben Oct 16 '12 at 5:19
    
@CharlieYabben: You are welcome. –  Mhenni Benghorbal Oct 16 '12 at 5:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.