
16.3 Least-Squares Fitting 729
where
¯x =
1
m
m
i=1
x
i
, ¯y =
1
m
m
i=1
y
i
,
¯
L =
1
m
m
i=1
L
i
,
¯
L
a
=
1
m
m
i=1
a − x
i
L
i
,
¯
L
b
=
1
m
m
i=1
b − y
i
L
i
Fixed-point iteration can be applied to solving these equations: a
0
=¯x, b
0
=¯y, and
a
i+1
= F(a
i
, b
i
) and b
i+1
= G(a
i
, b
i
) for i ≥0.
16.3.6 Fitting a Sphere to 3D Points
Given a set of points {(x
i
, y
i
, z
i
)}
m
i=1
, m ≥ 4, fit them with a sphere (x − a)
2
+
(y − b)
2
+ (z − c)
2
= r
2
,where(a, b, c) is the sphere center and r is the sphere
radius. An assumption of this algorithm is that not all the points are coplanar. The
error function to be minimized is
E(a, b, c, r) =
m
i=1
(L
i
− r)
2
where L
i
=
-
(x
i
− a)
2
+ (y
i
− b)
2
+ (z
i
− c). Take the partial derivative ...