Code covered by the BSD License

Highlights from Sphere Fit (least squared)

5.0

5.0 | 6 ratings Rate this file 117 Downloads (last 30 days) File Size: 30.7 KB File ID: #34129

Sphere Fit (least squared)

08 Dec 2011 (Updated )

Fits a sphere to a set of noisy data. Does not require a wide arc or many points.

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

File Information
Description

Given a set of data points, this function calculates the center and radius of the data in a least squared sense. The least squared equations are used to reduce the matrix that is inverted to a 3x3, opposed to doing it directly on the data set. Does not require a large arc or many data points. Assumes points are not singular (co-planar) and real...
Created on R2010b, but should work on all versions.

Required Products MATLAB
MATLAB release MATLAB 7.11 (R2010b)
23 Jan 2014

Dear Alan,
Outstanding work! Could you send me the related paper explaining this method?
samuel.reimer@tum.de

30 Jun 2013

Dear Alan, could you please, explain more about the two vectors A and B. I don't understand the rationality of Error function you defined as sum((x-xc)^2+(y-yc)^2+(z-zc)^2-r^2)^2,. Is the initial sphere center is taken for partial of the error of each parameter for example xc= mean(x), yc=mean (y) and zc= mean (z) and the function E = sum((xi-mean(x))^2+(y-mean(y))^2+(z-mean(z))^2-r^2)^2 and then, minimze the function E. many thanks

30 Jun 2013

Dear Alan, pointing to my previous comment, I have just want to correct the equation
E = sum((xi-mean(x))^2+(yi-mean (y))^2+(zi-mean(z))^2-r^2)^2
Regards

06 May 2013

Hi Alan,
Great work I would be happy if you could send me the related paper describing the method.
isxfha@nottingham.ac.uk

04 Apr 2013

Hi Alan. Great code! I really appreciate if you could send me the related paper describing the method:

jamesabott@yahoo.com

Many thanks!

26 Mar 2013

Hi Alan. Great work! can you please send me the relating papers?

simao.britodaluz@griffithuni.edu.au

much appreciated

11 Mar 2013

Hi Alan, any chance you could please send me the relating papers to c.carson@ncl.ac.uk?

Thanks for the code. Works perfect!

22 Jan 2013

Works great!

I was wondering if you could send me the paper as well (email: laurens.slot@gmail.com).

Also, how would this look if the radius was known?

19 Dec 2012

Dear Alan, can you send me the related papers? You know, I don't understand the rationality of Error function you defined as sum((x-xc)^2+(y-yc)^2+(z-zc)^2-r^2)^2, since I thought it was supposed to be sum(sqrt((x-xc)^2+(y-yc)^2+(z-zc)^2)-r)^2. My email: lhwsky@mail.ustc.edu.cn. many thanks

27 Aug 2012

Great piece of code!

13 Mar 2012

works great for my task, and thank you for sending me the related papers! :-)