1

I'm trying to fit a sphere from points. I tried a first way to estimate the sphere but I'm not satisfied. I saw in an article a way to get a best fitting sphere from the equation :

$z = a+bx+cy+dx^2 +ey^2$

Now, I have $a,b,c,d$ and $e$ values but I don't know what is the center of the sphere, radius ...

Do you have some explanation about this equation ?

Thank you.

Thomas
  • 43,555
usersss
  • 11
  • 1
    I believe it's a circle, not a sphere? – Tunococ Jun 04 '14 at 19:35
  • a $3-sphere$ ? as in the four dimensional analogue of the 'normal' sphere ? – The very fluffy Panda Jun 04 '14 at 19:36
  • How many point do you have? – Mark Bennet Jun 04 '14 at 19:37
  • I think @usersss meant to say 2-sphere, but probably doesn't understand what a 3-sphere really is. – Rocket Man Jun 04 '14 at 19:38
  • 1
    it's not a sphere unless it has $z^2$ in the equation – PA6OTA Jun 04 '14 at 19:41
  • The equation of a sphere with centre $a,b,c$ and radius $r$ is $(x-a)^2+(y-b)^2+(z-c)^2=r^2$, so your equation does not give you a sphere. The formula generalises to other dimensions in an obvious way - the circle is $(x-a)^2+(y-b)^2=r^2$. The symmetries of the sphere mean that isometries do not change the form of the equation. – Mark Bennet Jun 04 '14 at 19:41
  • @PA6OTA You also need $d=e=$ the coefficient of $z^2$ – Mark Bennet Jun 04 '14 at 19:42
  • This paper: http://dl.acm.org/citation.cfm?id=366824 is useful. An implementation of essentially this is available for MATLAB here: http://www.mathworks.com/matlabcentral/fileexchange/34129-sphere-fit--least-squared- – Carser Jun 04 '14 at 19:44
  • Ok thank you, sorry for the 3sphere. My first method use $(x−a)2+(y−b)2+(z−c)2=r2$ with a Nelder–Mead optimization but it's not very stable even with a large number of iterations and results changed according to initial values. – usersss Jun 04 '14 at 20:05
  • A very simple and straightforward method (no itterative, no initial values required) is described pp.17-18 in the paper published on Scribd : http://fr.scribd.com/doc/14819165/Regressions-coniques-quadriques-circulaire-spherique . The results are the coordinates of the center and the radius. – JJacquelin Jun 04 '14 at 20:16
  • For example, the special case $z=x^2+y^2$ is a cone. – GEdgar Jan 23 '16 at 16:28

1 Answers1

2

This is an extract (translated) from pp.17-18 http://fr.scribd.com/doc/14819165/Regressions-coniques-quadriques-circulaire-spherique

enter image description here

JJacquelin
  • 66,221
  • 3
  • 37
  • 87
  • 1
    I now have better results. Merci beaucoup. – usersss Jun 04 '14 at 21:11
  • @Chris : Thank you very much for your remark about the sign of $A_0$ in the equation for $R$. You are right, this was a typo. I rejected your corrected page because it is better to make the correction directly in the joint image instead of in an additional comment. Moreover, there was another typo in the 4X4 matrix, now fixed. All this was already mentioned by Alan Magnuson who I thank too. But sorry, up to now, I neglected to made the correction. – JJacquelin Jul 26 '18 at 15:03