Finding center and radius of sphere

9 ビュー (過去 30 日間)
Robert Smith
Robert Smith 2017 年 9 月 11 日
回答済み: Image Analyst 2017 年 9 月 12 日
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 件のコメント
OCDER
OCDER 2017 年 9 月 11 日
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.

サインインしてコメントする。

回答 (2 件)

Image Analyst
Image Analyst 2017 年 9 月 12 日
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 2017 年 9 月 11 日
Three points are not sufficient for that. You have four unknowns, not three: xc, yc, zc, and r makes four.
  2 件のコメント
Walter Roberson
Walter Roberson 2017 年 9 月 11 日
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 2017 年 9 月 12 日
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.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by