Graphics Reference
In-Depth Information
2.2
2
4
6
8
10
1.8
1.6
1.4
FIGURE 3.35
Sample data for path smoothing.
Smoothing with linear interpolation of adjacent values
An ordered set of points in two-space can be smoothed by averaging adjacent points. In the simplest
case, the two points, one on either side of an original point, P i , are averaged. This point is averaged with
the original data point ( Eq. 3.35 ) . Figure 3.36 shows the sample data plotted with the original data.
Notice how linear interpolation tends to draw the data points in the direction of local concavities.
Repeated applications of the linear interpolation to further smooth the data would continue to draw
the reduced concave sections and flatten out the curve.
P i 1 þP 1
2
P i þ
1
4 P i 1 þ
1
2 P i þ
1
4 P 1
0
i ¼
P
¼
(3.35)
2
Smoothing with cubic interpolation of adjacent values
To preserve the curvature but still smooth the data, the adjacent points on either side of a data point can
be used to fit a cubic curve that is then evaluated at its midpoint. This midpoint is then averaged with the
original point, as in the linear case. A cubic curve has the form shown in Equation 3.36 . The two data
points on either side of an original point, P i , are used as constraints, as shown in Equation 3.37 . These
equations can be used to solve for the constants of the cubic curve ( a , b , c , d ). Equation 3.36 is then
2.2
2
4
6
8
10
1.8
1.6
1.4
Original data
Smoothed data
FIGURE 3.36
Sample data smoothed by linear interpolation.
 
Search WWH ::




Custom Search