4.27273

4.3 | 11 ratings Rate this file 171 downloads (last 30 days) File Size: 989 Bytes File ID: #5557

Circle fit

by Izhak Bucher

 

26 Jul 2004 (Updated 29 Jul 2004)

No BSD License  

Fit a circle to a set of measured x,y points.

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

Download Now | Watch this File

File Information
Description

Revival of a 14 years old code (written in 1991 for MATLAB 2.x).

Given a set of measured x,y pairs that a re supposed to reside on a circle, but with some added noise. A circle to these points, i.e. find xc,yc,R, such that (x-xc)^2+(y-yc)^2=R^2

The method minimizes the sum of squared radial deviations.

Acknowledgements
This submission has inspired the following:
Ellipse Fit, Circle Fit (Kasa method), Circle Fit (Pratt method), Circle Fit (Taubin method)
MATLAB release MATLAB 5.2 (R10)
Zip File Content  
Other Files try_circ_fit.m,
circfit.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (16)
18 Aug 2004 Yuri Slobo...

Can someone please enlighten me where one meets such distributions to be fitted by a circle ?

25 Sep 2004 Yogesh Mehta

Yuri,

It can be extremely useful. For example, trying to fit a nyquist plot to an experimentally acquired FRFs... Ideally, nyquist plot is supposed to be a circle, but is not due 'noise'

05 Nov 2004 Bjorn Hemming

I have used this function to verify a feature in a Metrology software giving correctly first 4 digits, so it seems OK

22 Dec 2004 Knut C. Naue

Nice tool for data covering almost a complete circle. But if data exists describing only an arc, circfit fails identifying the assumed center and radius.

14 Mar 2005 Hedi Kawano

http://www.math.niu.edu/~rusin/known-math/99/circlefi tells you that the equation used in this "circle_fit.m" gives an approximate solution.

14 Mar 2005 Hedi Kawano

Sorry, it is
http://www.math.niu.edu/~rusin/known-math/99/circlefit
 (last "t" was missing)

21 Nov 2005 Tomaz Pepelnjak

Very useful if you need to fit measured points to the circle function and compare it further to reference value.

20 Feb 2006 Luigi Rosa

High-quality code, simple and effective

21 Feb 2006 shmi braun

Re: Hedi Kawano

  see also
http://www.pitchup.com/matlab/print.aspx?article=168

29 Sep 2006 Sanjeev Sharma

I found it to be very effective.

10 Dec 2006 Hendro Nurhadi

Just... Excellent.. thanks.
:-)

22 May 2007 Richard Brown

Note: This code doesn't minimise the sum of squared radial deviations - that is a nonlinear least squares problem

This code minimises sum((x.^2 + y.^2 - R^2).^2)

04 Dec 2007 Sebastian Laechele

Works very well!
I don't really know how, but it works! :D
You saved me a bunch of hours there.
Thank you very much!

31 Jan 2008 Darren Hewett  
08 Sep 2008 Mehmet Alpay

Works like a charm :-)

07 Jan 2009 Nikolai Chernov

This circle fit has been first published by P.Delogne and I.Kasa in the 1970s and is known as "Kasa method" in statistics. It works well when points cover a large part of the circle but is heavily biased when points are restricted to a small arc. Better fits were proposed by Pratt and Taubin.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
approximation Izhak Bucher 22 Oct 2008 07:28:18
interpolation Izhak Bucher 22 Oct 2008 07:28:18
circle fit Izhak Bucher 22 Oct 2008 07:28:18
least squares Izhak Bucher 22 Oct 2008 07:28:18
approximations Izhak Bucher 22 Oct 2008 07:28:19
circle Izhak Bucher 22 Oct 2008 07:28:19
potw Cristina McIntire 07 Nov 2008 13:23:47
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com