Least Squares Circle Fit

markraz

Full Member
Joined
Feb 19, 2014
Messages
338
Hi, I have a bunch of points in form of x,y (0, 1), (2, 5), (1, 6), and (7, 6)
and I'm trying to understand circle regression using least squares. I can't find any examples anywhere. But I did find this picture of a matrix that might do the trick.

1601163970209.png

So I think I first need to understand these summation terms within the matrix

row1 column1 it is Sum( xi^2) = does this mean I add all the x values up and square them? or do I square all the x values and then add them?
row1 column2 it is Sum( xi yi) = does this mean I multiply all the points first and then sum them? {(x1 * y1) + (x2 * y2) + (x3 * y3)+ (xn * yn).......} ??
so ..... sum{(0 * 1) + (2 * 5) + (1 * 6)+ (7 * 6)}

row 1 column3 it is Sum( xi) = does this mean I add all the x values? 0 + 2 + 1 +7
row 3 column 3 it is n = do I just put the number of points here? (4 in my case)

the rest are similar to above

thanks in advance
 
Last edited:
Hi, I have a bunch of points in form of x,y (0, 1), (2, 5), (1, 6), and (7, 6)
and I'm trying to understand circle regression using least squares. I can't find any examples anywhere. But I did find this picture of a matrix that might do the trick.

View attachment 21891

So I think I first need to understand these summation terms within the matrix

row1 column1 it is Sum( xi^2) = does this mean I add all the x values up and square them? or do I square all the x values and then add them?
row1 column2 it is Sum( xi yi) = does this mean I multiply all the points first and then sum them? {(x1 * y1) + (x2 * y2) + (x3 * y3)+ (xn * yn).......} ??
so ..... sum{(0 * 1) + (2 * 5) + (1 * 6)+ (7 * 6)}

row 1 column3 it is Sum( xi) = does this mean I add all the x values? 0 + 2 + 1 +7
row 3 column 3 it is n = do I just put the number of points here? (4 in my case)

the rest are similar to above

thanks in advance
[MATH]\sum[/MATH]xi2=x12+x22+...+xn2. The other rows look right. If you want to understand what is going on you may look into this paper: https://www.emis.de/journals/BBMS/Bulletin/sup962/gander.pdf
or this one: http://www.dtcenter.org/sites/default/files/community-code/met/docs/write-ups/circle_fit.pdf
 
Hi, I have a bunch of points in form of x,y (0, 1), (2, 5), (1, 6), and (7, 6)
and I'm trying to understand circle regression using least squares. I can't find any examples anywhere. But I did find this picture of a matrix that might do the trick.

View attachment 21891

So I think I first need to understand these summation terms within the matrix

row1 column1 it is Sum( xi^2) = does this mean I add all the x values up and square them? or do I square all the x values and then add them?
row1 column2 it is Sum( xi yi) = does this mean I multiply all the points first and then sum them? {(x1 * y1) + (x2 * y2) + (x3 * y3)+ (xn * yn).......} ??
so ..... sum{(0 * 1) + (2 * 5) + (1 * 6)+ (7 * 6)}

row 1 column3 it is Sum( xi) = does this mean I add all the x values? 0 + 2 + 1 +7
row 3 column 3 it is n = do I just put the number of points here? (4 in my case)

the rest are similar to above

thanks in advance
row1 column1 it is Sum( xi^2) = does this mean I add all the x values up and square them? or do I square all the x values and then add them?

row1 column2 it is Sum( xi yi) = does this mean I multiply all the points first and then sum them? {(x1 * y1) + (x2 * y2) + (x3 * y3)+ (xn * yn).......} ??
so ..... sum{(0 * 1) + (2 * 5) + (1 * 6)+ (7 * 6)} ............Correct

row 1 column3 it is Sum( xi) =
does this mean I add all the x values? 0 + 2 + 1 +7............Correct

row 3 column 3 it is n =
do I just put the number of points here? (4 in my case)............Correct
 
row1 column1 it is Sum( xi^2) = does this mean I add all the x values up and square them? or do I square all the x values and then add them?

row1 column2 it is Sum( xi yi) = does this mean I multiply all the points first and then sum them? {(x1 * y1) + (x2 * y2) + (x3 * y3)+ (xn * yn).......} ??
so ..... sum{(0 * 1) + (2 * 5) + (1 * 6)+ (7 * 6)} ............Correct

row 1 column3 it is Sum( xi) =
does this mean I add all the x values? 0 + 2 + 1 +7............Correct

row 3 column 3 it is n =
do I just put the number of points here? (4 in my case)............Correct
appreciate it, thanks !!!
 
Ok thanks everyone. My next question is this top row of the 'b' matrix
1601228378436.png

again my set of points
(0, 1), (2, 5), (1, 6), and (7, 6)

first row in vector sum xi(xi^2 + yi^2)
0 * (0^2 + 1^2) +
2 * (2^2 + 5^2) +
1 * (1^2 + 6^2) +
7 * (7^2 + 6^2)

second row in vector sum yi(xi^2 + yi^2)
1 * (0^2 + 1^2) +
5 * (2^2 + 5^2) +
6 * (1^2 + 6^2) +
6 * (7^2 + 6^2)


thanks in advance
 
Ok thanks everyone. My next question is this top row of the 'b' matrix
View attachment 21894

again my set of points
(0, 1), (2, 5), (1, 6), and (7, 6)

first row in vector sum xi(xi^2 + yi^2)
0 * (0^2 + 1^2) +
2 * (2^2 + 5^2) +
1 * (1^2 + 6^2) +
7 * (7^2 + 6^2)

second row in vector sum yi(xi^2 + yi^2)
1 * (0^2 + 1^2) +
5 * (2^2 + 5^2) +
6 * (1^2 + 6^2) +
6 * (7^2 + 6^2)


thanks in advance
Everything looks fine.
 
Top