Professional Documents
Culture Documents
An algebraic solution was given in [1] for the problem of fitting a circle to three-dimensional data
points not lying in the -plane. In [2], this solution is crafted as a Matlab project whose steps we
articulate in Table 1.
1.
Translate all
will pass through (or nearly through) the origin.
2.
3.
4.
5.
matrix
are the components of the vectors
with respect to the basis vectors
. Since n
the entries in the third row of are small.
are
is
6.
each column of
as
, a point in an
-plane.
Table 1 Essential steps in an algebraic solution to the problem of fitting a circle in space
to 3-D data
We will implement the algebraic solution in Maple, then provide an alternate analytic solution based
on the direct minimization of the sum of squares of deviations. The analytic technique, suggested by
[3], simultaneously fists a plane to the data, while finding the radius of the circle by minimizing the
sum of squares of deviations of each point from a line parallel to the normal to the fitting plane.
Initializations
Load packages and define initial data by clicking on the icon below.
Algebraic Solution
Each of the ten columns of the following matrix are the Cartesian coordinates of data points taken
from [2].
To each data point, we add random noise of magnitude less than 1.5. The perturbations for each
coordinate are in the matrix
The coordinates of the centroid of these points appear as the components of the following vector.
The coordinates of the centroid is subtracted from each point; the columns of the resulting matrix
are vectors ,
The singular value decomposition of this matrix provides the factor and the vector S of singular
values. The matrix contains orthonormal bases for the column space of and for its orthogonal
complement.
the magnitude of the noise in the data increases, this third singular value gets larger. Hence, the
algebraic approach advocated in [1] is less robust than the analytic approach sketched in the next
section.
If the translated points lie on a plane through the origin, the column space of
will be two-
is
That
that is,
in the form
where
Consequently, in the translated and tilted plane, the fitting circle has
for the radius and center, respectively. Again, note that the center is in coordinates relative to the
orthonormal basis
. The coordinates of this center, in the space of the original data, are then
In the presence of noise, the third row in the matrix does not represent a zero component along the
normal to the plane spanned by
Thus, an essential condition for the validity of the algebraic
solution is not met. The theory requires that the data lie in a plane for the algebraic method illustrated
here to be applicable. Yet, as we will see, the algebraic solution is close to the analytical solution
obtained below.
Analytic Solution
An analytic solution of the problem of fitting a circle to points in three-dimensions begins with the
following definitions.
Set equal to zero, the first expression defines the plane through the point
i+
j+
and having
for its normal of length one. The second expression is the distance of the point
to the line
parallel to the normal, and passing through
. Figure 1, using concepts from multivariate
calculus, is a basis for obtaining this function.
When the point
is projected onto the line whose
direction is given by the unit vector , a right triangle is
n
so
therefore can write
. Because
X KC
q
Figure 1 Distance from the
point
to the line with
direction
To obtain an estimate of where the center of the sphere might lie, we form lists of -, -, and coordinates
then compute the average of the extreme values for each coordinate.
5.184000000
5.612000000
The sum of squares of the deviations of the data points from both the plane and the line is given by
6.740205892
where we constrain the normal vector to have unit length. Thus, the center and radius of the sphere
are
Figure 2 shows this plane, the data points, and the computed center.
Click the icon below to generate Figure 2.
, and defined by
as
which specializes to
Figure 3 shows the fitted points, the fitting circle, the plane in which this circle lies, and the center of
the fitting circle.
Click the icon below to generate Figure 3.
References
[1]
Carl C. Cowen, "A Project on Circles in Space." In Resources for Teaching Linear Algebra.
Edited by David Carlson, Charles R. Johnson, David Lay, A. Duane Porter, Ann Watkins,
and William Watkins. Washington, D.C.: MAA, 1996.
[2]
ATLAST: Computer Exercises for Linear Algebra, Steven Leon, Eugene Herman, Richard
Faulkenberry, Prentice-Hall, Inc., Upper Saddle River, NJ, 1996.
[3]
Legal Notice: Maplesoft, a division of Waterloo Maple Inc. 2010. Maplesoft and Maple are
trademarks of Waterloo Maple Inc. This application may contain errors and Maplesoft is not liable for
any damages resulting from the use of this material. This application is intended for non-commercial,
non-profit use only. Contact Maplesoft for permission if you wish to use this application in for-profit
activities.