math - Sphere center point and radius from 3 points on the surface -
is possible find center of sphere , radius 3 points on surface ?
i'm building model segmented brain structure 3 points within structure; head, tail , middle.
thank you,
express center of sphere equidistant 3 given points , coplanar them (assuming 3 given points on great circle).
(x - xa)² + (y - ya)² + (z - za)² = r² (x - xb)² + (y - yb)² + (z - zb)² = r² (x - xc)² + (y - yc)² + (z - zc)² = r² |x y z 1| |xa ya za 1| |xb yb zb 1| = 0 |xc yc zc 1|
subtracting first equation second , third, rid of quadratic terms.
(2x - xb - xa)(xb - xa) + (2y - yb - ya)(yb - ya) + (2z - zb - za)(zb - za) = 0 (2x - xc - xa)(xc - xa) + (2y - yc - ya)(yc - ya) + (2z - zc - za)(zc - za) = 0
now have easy linear system of 3 equations in 3 unknowns.
for conciseness can translate 3 points xa=ya=za=0
, , equations simplify as
|x y z | |xb yb zb| = 0 |xc yc zc| (2x - xb) xb + (2y - yb) yb + (2z - zb) zb = 0 (2x - xc) xc + (2y - yc) yc + (2z - zc) zc = 0
or
(yb zc - yc zb) x + (zb xc - zc xb) y + (xb yc - xc yb) z = 0 2 xb x + 2 yb y + 2 zb z = xb² + yb² + zb² 2 xc x + 2 yc y + 2 zc z = xc² + yc² + zc²
then, r² = x² + y² + z²
, , don't forget translate back.
Comments
Post a Comment