Approximation of data using cu-
bic B
´
ezier curve least square fitting
Author: M Khan
Email: mak2000sw@yahoo.com
URL: http://www.geocities.com/mak2000sw
1 B
´
ezier Curve
B
´
ezier curve is a parametric curve. A B
´
ezier curve of degree m can be generalized as
follows:
q(t
i
) =
m
∑
k=0
m
k
P
k
(1−t
i
)
m−k
t
k
i
, 0 ≤ t
i
≤ 1, (1)
where q(t
i
) is an interpolated point at parameter value t
i
, m is degree of B
´
ezier curve
and P
k
is k
th
control point. To generate n points (n is count of interpolating points)
between first and last control points inclusive, the parameter t
i
is uniformly divided
into n−1 intervals between 0 and 1 inclusive. Equations of cubic B
´
ezier curves can be
derived from Eq. (1) as follows:
q(t
i
) = (1−t
i
)
3
P
0
+ 3t
i
(1−t
i
)
2
P
1
+ 3t
2
i
(1−t
i
)P
2
+t
3
i
P
3
. (2)
B
´
ezier curve passes through its first and last control points i.e., P
0
and P
3
. The
middle control points, i.e. P
1
and P
2
determine the shape of curve.
2 Least Square B
´
ezier Fitting
For data to be fit by cubic B
´
ezier the first and last control points of B
´
ezier curve are
first and last point of the input data segment. The input data can be divided into many
segments or just one segment by specifying the initial set of break points. But the
the middle control points, i.e., P
1
and P
2
for cubic B
´
ezier must be determined. We
used least square method to find the middle control points. Least square method gives
the best values of middle control points that minimize the squared distance between
original and fitted data and is well suited for approximating data. If there are n data
points and p
i
and q(t
i
) are values of original and approximated points respectively then
we can write the least square equation as follows:
S =
n
∑
i=1
[p
i
− q(t
i
)]
2
. (3)
Eq. (3) can be written as follows:
1