Curve continued……
• Consider we want a polynomial curve that will pass through
n sample points (x1.x1,z1),(x2,y2,z2)….(xn,yn,zn). The function
will be constructed as the sum of terms with one term for
each sample point. These functions are given by,
fx(u)=∑xiBi(u)
fy(u)=∑yiBi(u)
fz(u)=∑ziBi(u)
The function Bi(u) is called as the ‘blending function’.
• For each value of u, the blending function determines how
much the ith sample point affects the position of the curve.
If for some value of u, bi(u) =1 for a specific i value, then this
sample point has complete control over the curve, & the
curve will pass through this point. For a different value of u,
some other sample point may have control over the curve &
in this case the curve will pass through this point as well.
Thus, in general blending function gives control of the
curve to each sample point for different values of u.
• The general form ith blending function which is 1 at u=i-2 &
0 for other integers is given as,
Bi(u)=(u+1)(u)(u-1)…[u-(i-3)][u-(i-1)]..[u-(i-2)].
(i-1)(i-2)(i-3)…(1)(-1)..(i-n)
The approximation of the curve using the above expression
is called ‘Lagrange interpolation’
• From the above blending functions, four sampling points
can be given as,
B1(u)= u(u-1)(u-2)
(-1)(-2)(-3).
B2(u)=(u+1)(u-1)(u-2)
1(-1)(-2)
B3(u)=(u+1)u(u-2)
(2)(1)(-1)
B4(u)=(u+1)u(u-1)
(3)(2)(1).
Thus, using the blending functions the values for sampling
points can be found out.
• Using the above blending functions, the expression for
curve passing through sampling points can be realized as
below.
X=x1B1(u)+x2B2(u)+x3B3(u)+x4B4(u)
y=y1B1(u)+y2B2(u)+y3B3(u)+y4B4(u)
z=z1B1(u)+z2B2(u)+z3B3(u)+z4B4(u)
It is also possible to take intermediate points between two
sampling points by taking values of u between the values of
u related to the two sample points under consideration.
• For e.g. consider sample points (1,2,3,4) are taken and
intermediate points between(2,3) are obtained. Then sample
point at one end is discarded and sample point at other end
is added to get sample points(2,3,4,5). Now the point
between(3,4) is approximated.
The subsequent intermediate points can be
obtained in a similar fashion. The initial and final portions of
the curve require special treatment.
Interpolating algorithm.
1. Get the sample points.
2. Get intermediate value of u to
determine intermediate points.
3. Calculate blending function value for
first section of curve.
4. Calculate blending function value for
middle section of curve.
• 5. Calculate blending function value for
last section of curve.
• 6. Multiply sample points by blending
functions to give points on
approximation curve.
• 7. Connect the neighboring points
using line segments.
• 8. STOP.