Professional Documents
Culture Documents
fall, 2011
Table of contents
Aitkens Algorithm Lagrange Polynomials The Vandermonde Approach Limits of Lagrange Interpolation Cubic Hermite Interpolation Quintic Hermite Interpolation Point-Normal Interpolation Least Squares Approximation Smoothing Equations Designing with Bezier Curves The Newton Form and Forward Differencing
Motivation
Approximation: nd a (polynomial) curve that goes through the data closely in a reasonable way.
Outline
Aitkens Algorithm Lagrange Polynomials The Vandermonde Approach Limits of Lagrange Interpolation Cubic Hermite Interpolation Quintic Hermite Interpolation Point-Normal Interpolation Least Squares Approximation Smoothing Equations Designing with Bezier Curves The Newton Form and Forward Differencing
Aitkens Algorithm
Problem: Given points tpi un 0 with corresponding i parameter values tti un 0 , nd a curve pptq such that i ppti q pi , i 0, . . . , n.
i 0, . . . , n 1.
2. Let pn1 ptq is a polynomial of degree n 1 that 0 interpolates p0 , . . . , pn1 and pn1 ptq is one that 1 interpolates p1 , . . . , pn . 3. Then pn ptq 0
p1 ptq is a line segment for ti t ti1 . i p1 ptq interpolates pi and pi1 : p1 pti q pi and i i p1 pti1 q pi1 . i
r 1, . . . , n i 0, . . . , n r.
Properties
Afne invariance Linear precision No convex hull property Is it possible for a smooth interpolating curve has a convex hull property? No variation diminishing property Does not answer if such polynomial curve is unique. Not a closed form
Outline
Aitkens Algorithm Lagrange Polynomials The Vandermonde Approach Limits of Lagrange Interpolation Cubic Hermite Interpolation Quintic Hermite Interpolation Point-Normal Interpolation Least Squares Approximation Smoothing Equations Designing with Bezier Curves The Newton Form and Forward Differencing
Lagrange Polynomials
The interpolating curve is given by pptq where Ln i
n
i 0
pi Ln ptq i
where i,j is the Kronecker delta. tLnptqun0 form a basis of all polynomials of degree n i i Interpolating polynomial (of degree n) is unique
n i 0
Ln ptq 1ptq i
Outline
Aitkens Algorithm Lagrange Polynomials The Vandermonde Approach Limits of Lagrange Interpolation Cubic Hermite Interpolation Quintic Hermite Interpolation Point-Normal Interpolation Least Squares Approximation Smoothing Equations Designing with Bezier Curves The Newton Form and Forward Differencing
aj tj
pn ptn q pn
p0 1 t0 tn a0 n "p1 0 "1 t1 t0 0 "a1 0 10" 0 " 0 " 2. " . 0 " . . . p Ta . ) !. . .. . 0 " . 0 . )! . ) !. . . . . pn 1 tn tn an n n 3. If ttj uj 0 are distinct, det T $ 0. (Why?) det T is the Vandermonde of the interpolation problem 4. Solution: a T 1 p
Generalized Vandermonde
For some basis tFjn ptqun0 , (e.g. Bernstein basis) the j interpolating polynomial is expressed as p pt q
n n j 0
cj Fjn ptq
c1 F n pt0 q F n pt0 q F n pt0 q n "c2 0 "F0n pt1 q F1n pt1 q Fn pt1 q0 n 1 0 " .. 0 " 0 .. " 0 " . . 0 .. . . ) !.) ! . . . . n n n cn F0 ptn q F1 ptn q Fn ptn q
(1
Outline
Aitkens Algorithm Lagrange Polynomials The Vandermonde Approach Limits of Lagrange Interpolation Cubic Hermite Interpolation Quintic Hermite Interpolation Point-Normal Interpolation Least Squares Approximation Smoothing Equations Designing with Bezier Curves The Newton Form and Forward Differencing
The process is ill-conditioned. Polynomial interpolation is not shape preserving. Runge phenomonen for construction (solving dense linear system) for evaluation (for high n)
Expensive to solve
Outline
Aitkens Algorithm Lagrange Polynomials The Vandermonde Approach Limits of Lagrange Interpolation Cubic Hermite Interpolation Quintic Hermite Interpolation Point-Normal Interpolation Least Squares Approximation Smoothing Equations Designing with Bezier Curves The Newton Form and Forward Differencing
1. b0 2.
9
3 p0 B 0
ptq
p0
d 3 dt H0 d 3 dt H1 d 3 dt H2 d 3 dt H3
p0 q 0 p0 q 1 p0 q 0 p0 q 0
d 3 dt H0 d 3 dt H1 d 3 dt H2 d 3 dt H3
p1 q 0 p1 q 0 p1 q 1 p1 q 0
Outline
Aitkens Algorithm Lagrange Polynomials The Vandermonde Approach Limits of Lagrange Interpolation Cubic Hermite Interpolation Quintic Hermite Interpolation Point-Normal Interpolation Least Squares Approximation Smoothing Equations Designing with Bezier Curves The Newton Form and Forward Differencing
Outline
Aitkens Algorithm Lagrange Polynomials The Vandermonde Approach Limits of Lagrange Interpolation Cubic Hermite Interpolation Quintic Hermite Interpolation Point-Normal Interpolation Least Squares Approximation Smoothing Equations Designing with Bezier Curves The Newton Form and Forward Differencing
Outline
Aitkens Algorithm Lagrange Polynomials The Vandermonde Approach Limits of Lagrange Interpolation Cubic Hermite Interpolation Quintic Hermite Interpolation Point-Normal Interpolation Least Squares Approximation Smoothing Equations Designing with Bezier Curves The Newton Form and Forward Differencing
How to measure the closeness of the approximating curve and the data points? least squares approximation: To nd a polynomial curve xptq that minimizes f pc0 , . . . , cn q
P j 0
xptj q pj
2. Assuming xptq interpolates all the points tpj uP0 , we get a j linear system C n pt0 q " 0 .. ! .
n C0
.. .
pt P q
n C n pt 0 q c0 p0 . 0" . 0 " . 0 . )! . ) ! . ) . . . n Cn
ptP q
MC P
cn
pP
where M
M T M is always invertible. (Why?) The solution minimizes f p c0 , . . . , cn q (Why?) The solution satises
P
xpt q p
j
j 0
ff fcd 0, k
0, . . . , n, d 1, 2, 3.
Outline
Aitkens Algorithm Lagrange Polynomials The Vandermonde Approach Limits of Lagrange Interpolation Cubic Hermite Interpolation Quintic Hermite Interpolation Point-Normal Interpolation Least Squares Approximation Smoothing Equations Designing with Bezier Curves The Newton Form and Forward Differencing
Smoothing Equations
Minimizing the least square error does not guarantee a good curve. (Fig 7.8) We want a curve that does not wiggle much. (How?) If the control polygon behaves nicely, then so does the curve.
How to minimizes wiggling (of the polygon)? minimize the 2nd differences 2 bi b0 2b1 b2 . . .
0 0
bn2 2bn1 bn
SB 0
&
M P B S 0
&
p1 qM
S
&
p1 qP B 0
&
01
Outline
Aitkens Algorithm Lagrange Polynomials The Vandermonde Approach Limits of Lagrange Interpolation Cubic Hermite Interpolation Quintic Hermite Interpolation Point-Normal Interpolation Least Squares Approximation Smoothing Equations Designing with Bezier Curves The Newton Form and Forward Differencing
What if we want to move a point on the curve to change the shape? Given a Bezier curve xptq
n i 0 n bi Bi ptq,
if we change a point xptq to y, how should we change tbi u to tbi u such that the curve passes through y at t t? y
n i 0
n bi Bi ptq
n B1 ptq
2. Assume all the points b1 , . . . , bn1 move along (unknown) c direction: B B AT c AB AB AAT c z AB AAT c 3. Since AAT is a scalar, with a : AAT c 1 1 p y x q B B a AT p y x q . a
Outline
Aitkens Algorithm Lagrange Polynomials The Vandermonde Approach Limits of Lagrange Interpolation Cubic Hermite Interpolation Quintic Hermite Interpolation Point-Normal Interpolation Least Squares Approximation Smoothing Equations Designing with Bezier Curves The Newton Form and Forward Differencing
For equally spaced parameter intervals: ti1 For cubic case, pptq p0
ti h
where
i pj : i1 pj 1 i1 pj
pj .
g 3 3 p0 g 3 3 p1 g 3 3 p2 . . .
In general, with qi : g i i pj , j
and pj
q0 . j
qij11 qij1,
i 2, 1, 0
No multiplication involved! (after start-up phase) extremely fast Given a polynomial in cubic Bezier form, Roundoff error is accumulated The curve may deviates more and more...
1. Compute initial four points. 2. Evaluate sequence of points and plot using line segments.