f

#### Re: best fit (least squares) of sphere

```On Fri, 6 Mar 2009 13:57:01 +0000 (UTC), Michael wrote:

> Hello,
>
> I have point cloud data that is in t,x,y,z format of a hemispherical surface.  What I need to be able to do is calculate the center point and radius of the best fit sphere.  Unfrotunately, I can not simple calculate the distance from a global origin.
>
> Anyone have any suggestions?

Write a functional which have to be minimised in least square sense. Then
traditional methods (which rely on function derivation) can be used.
```
 0
3/6/2009 2:37:22 PM
comp.soft-sys.matlab 211266 articles. 25 followers. lunamoonmoon (257) is leader.

2 Replies
682 Views

Similar Articles

[PageSpeed] 36

```doert <no_mail@mail.com> wrote in message <csmkmmp5fbso.13dwb7jdow8xv.dlg@40tude.net>...
> On Fri, 6 Mar 2009 13:57:01 +0000 (UTC), Michael wrote:
>
> > Hello,
> >
> > I have point cloud data that is in t,x,y,z format of a hemispherical surface.  What I need to be able to do is calculate the center point and radius of the best fit sphere.  Unfrotunately, I can not simple calculate the distance from a global origin.
> >
> > Anyone have any suggestions?
>
> Write a functional which have to be minimised in least square sense. Then
> traditional methods (which rely on function derivation) can be used.

Hmm. I wrote this a few months ago. I've got a
new version that estimates the parameters for
an n-sphere (a 2-sphere is a circle) in p dimensions.
In this case, it finds the subspace that contains
your data, and then fits a sphere of appropriate
dimensionality in the subspace.

I'll post it on the file exchange asap.

John
```
 0
woodchips (7944)
3/6/2009 4:17:01 PM
```Hello, John!

Could you post that file when you have a chance?? I am facing a similar problem.

"John D'Errico" <woodchips@rochester.rr.com> wrote in message <gori9t\$kim\$1@fred.mathworks.com>...
> doert <no_mail@mail.com> wrote in message <csmkmmp5fbso.13dwb7jdow8xv.dlg@40tude.net>...
> > On Fri, 6 Mar 2009 13:57:01 +0000 (UTC), Michael wrote:
> >
> > > Hello,
> > >
> > > I have point cloud data that is in t,x,y,z format of a hemispherical surface.  What I need to be able to do is calculate the center point and radius of the best fit sphere.  Unfrotunately, I can not simple calculate the distance from a global origin.
> > >
> > > Anyone have any suggestions?
> >
> > Write a functional which have to be minimised in least square sense. Then
> > traditional methods (which rely on function derivation) can be used.
>
> Hmm. I wrote this a few months ago. I've got a
> new version that estimates the parameters for
> an n-sphere (a 2-sphere is a circle) in p dimensions.
> In this case, it finds the subspace that contains
> your data, and then fits a sphere of appropriate
> dimensionality in the subspace.
>
> I'll post it on the file exchange asap.
>
> John
```
 0
3/23/2009 2:50:04 AM