Finding center and radius of sphere

8 visualizaciones (últimos 30 días)
Robert Smith
Robert Smith el 11 de Sept. de 2017
Respondida: Image Analyst el 12 de Sept. de 2017
I'm looking to calculate the radius of a sphere knowing only 3 points on the circumference. I know its mathematically possible I just don't know how to write a program that will do this. I intend to use the equation of a sphere:
(sqrt((x-xc)^2)+((y-yc)^2)+((z-zc)^2))) = r
Where the center is (xc,yz,zc) and a point on the circumference is (x,y,z). I will select 3 points on the sphere to plug into this equation.
I need to calculate the center and the radius. Does anyone know how to write a program that will do this?
  1 comentario
OCDER
OCDER el 11 de Sept. de 2017
Were you referring to selecting 3 points on the circumference of a circular plane that intersects the center of a sphere? https://math.stackexchange.com/questions/1076177/3d-coordinates-of-circle-center-given-three-point-on-the-circle
If so, might want to put the last equation required to solve this.

Iniciar sesión para comentar.

Respuestas (2)

Image Analyst
Image Analyst el 12 de Sept. de 2017
This will give you the center (xCenter, yCenter, zCenter) and the radius given 3 points on the circumference (widest part, not like on some small cap) of the sphere. So that's all you need to define a sphere.

Walter Roberson
Walter Roberson el 11 de Sept. de 2017
Three points are not sufficient for that. You have four unknowns, not three: xc, yc, zc, and r makes four.
  2 comentarios
Walter Roberson
Walter Roberson el 11 de Sept. de 2017
syms x x1 x2 x3 x4 y y1 y2 y3 y4 z z1 z2 z3 z4 xc yc zc real
syms r nonnegative
eqn = (sqrt((x-xc)^2)+((y-yc)^2)+((z-zc)^2)) == r^2;
eqn1 = subs(eqn, [x y z], [x1 y1 z1]);
eqn2 = subs(eqn, [x y z], [x2 y2 z2]);
eqn3 = subs(eqn, [x y z], [x3 y3 z3]);
eqn4 = subs(eqn, [x y z], [x4 y4 z4]);
sol = solve([eqn1, eqn2, eqn3, eqn4],[xc yc zc r])
This will find 28 solutions: four points are not enough to determine the which side of the given points the centre is; you need five points for that.
Image Analyst
Image Analyst el 12 de Sept. de 2017
I'm not sure I buy that you need 4. Three points define a circle, and since the points are on the circumference (widest part of the sphere, not any old place, you got everything you need.

Iniciar sesión para comentar.

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by