code to estimate center of sphere?
-
Are there any codes out there that helps me to estimate or calculate the center of a sphere from a set of data points on the surface of the sphere? for eg., least-squares fitting of a set of points to the equation of a sphere? THANKS!
-
Are there any codes out there that helps me to estimate or calculate the center of a sphere from a set of data points on the surface of the sphere? for eg., least-squares fitting of a set of points to the equation of a sphere? THANKS!
mm don't know any code but if I'm not mistaken the radius is in the equation correct? this means you have the distance of each point on the sphere to the center. take to points and calculate which point is on distance = radius to the two known points. If you don't know your formulas, search the net. you need the equation of the sphere and the equations for calculating the distances. (Don't know it by heart sorry, it 's something with roots and power to two etc) good luck. No hurries, no worries.
-
Are there any codes out there that helps me to estimate or calculate the center of a sphere from a set of data points on the surface of the sphere? for eg., least-squares fitting of a set of points to the equation of a sphere? THANKS!
At first I tried to remember 3D math, surface equations and surface normals But solution is easy if I do not misunderstand You have limited sample points (x,y,z) of a sphere. Search all samples and obtain Minimim and Maximum value of X,Y,Z; The center of the sphere is (Xcenter,Ycenter,Zcenter) The equation should be so; Xcenter = (Xmin + Xmax) / 2 Ycenter = (Ymin + Ymax) / 2 Zcenter = (Zmin + Zmax) / 2 I hope it helps you
-
Are there any codes out there that helps me to estimate or calculate the center of a sphere from a set of data points on the surface of the sphere? for eg., least-squares fitting of a set of points to the equation of a sphere? THANKS!
Or you can apply clasiccal method; You should have at least three surface point to obtain a sphere. (Xo,Yo,Zo) is center coordiane of sphere and r is half of diameter Sphere equation is (X - Xo)^2 + (Y - Yo)^2 + (Z - Zo)^2 = r^2 We have 3-samples Sample1 : (X1,Y1,Z1) Sample2 : (X2,Y2,Z2) Sample3 : (X3,Y3,Z3) Place these three sample to the above equation, and then you will obtain 3 equation with unknown Xo,Yo,Zo parameters. You can easily calculate these with three equation.