# Re: Fitting Circles

• Subject: Re: Fitting Circles
• Date: Wed, 01 Dec 1999 10:39:20 -0600
• Newsgroups: comp.lang.idl-pvwave
• Organization: Abbott Labs Pharmaceutical Products Division
• References: <823aia\$bqt\$1@nnrp1.deja.com>
• Xref: news.doit.wisc.edu comp.lang.idl-pvwave:17564

```How about doing a transformation and solving a simpler problem:

What you want to fit is r0 = [(x-x0)^2+(y-y0)^2]^(0.5)
So minimize:
r0 - [(x-x0)^2+(y-y0)^2]^(0.5)

for all pairs of (x,y).  This can be done using your favorite fitting
routine (I like Craig markwardt's MPFIT... routines,
http://cow.physics.wisc.edu/~craigm/idl/idl.html)

Good luck

F.N.Hatfield@Leeds.ac.uk wrote:
>
> Dear Colleagues,
>
> I am trying to fit a circle to a set of points (x,y), and from this
> determine the centre point (x0,y0) and radius r0. It is also very
> important that I obtain the standard deviations or errors in the x0,y0
> and r0.
>
> So far, I have looked at the idl routine, curvefit.pro.
> This is a useful program but doesn't seem to allow you to pass 2
> independent variables x and y.
> I was wondering if someone has written something similar in idl,
> or could suggest a way to solve this problem.
>
> Cheers
>
> Fraser Hatfield
>
> University of Leeds, UK.
>
> Sent via Deja.com http://www.deja.com/