Xref: utzoo comp.graphics:5971 sci.math:6865 sci.math.num-analysis:2 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!bloom-beacon!husc6!osf!flowers From: flowers@osf.OSF.ORG (Ken Flowers) Newsgroups: comp.graphics,sci.math,sci.math.num-analysis Subject: Re: Need to fit a circle to some points Keywords: circle algorithm least-squares fit Message-ID: <1088@osf.OSF.ORG> Date: 1 Jun 89 20:28:48 GMT References: <573@lehi3b15.csee.Lehigh.EDU> Reply-To: flowers@osf.org (Ken Flowers) Organization: Open Software Foundation Lines: 36 In article <573@lehi3b15.csee.Lehigh.EDU> flash@lehi3b15.csee.Lehigh.EDU (Stephen Corbesero) writes: > >I need an algorithm to fit a set of data points, obtained >experimentally, to the best-fit circle. I have searched through many >book son least squares anaylsis, but can only find simple cases. I >started to do the math, but it became rather involved very quickly. > >I would appreciate it if i can get code to do this, or perhaps leads >as to where I can continue looking. > >Thanks in advance.... > >-- >Stephen Corbesero flash@lehi3b15.UUCP >VLSI Design Automation Lab flash@lehi3b15.CSEE.Lehigh.EDU >Computer Science And Electrical Engineering, usgcorb@vax1.CC.Lehigh.EDU >Lehigh University, Bethlehem, PA 18015 Not being a mathmatician, (but I did start a math major at MIT. Finally went on to MechE.) please excuse any level of ignorance. It seems to me that the best fit circle can be simply found by doing the following: 1. Make the center the average point of all the data points. 2. Make the radius the average distance from the center to each data point. This gives also the smallest best fit circle, because as we can see from the two point generalization that an infinate number of circles can fit exactly. Also, if we take a radius significantly larger than the range of the data and then place the data around a small segment of the resulting circle, that seems like a preaty damn good fit also. What it turns out were doing in this case, if we make the radius suffiently large, is creating the best fit line.