View
228
Download
0
Tags:
Embed Size (px)
Citation preview
1
Dr. Scott Schaefer
Curves and Interpolation
2/61
Smooth Curves
How do we create smooth curves?
3/61
Smooth Curves
How do we create smooth curves?
Parametric curves with polynomials
)(),()( tytxtp
4/61
Smooth Curves
Controlling the shape of the curve
32
32
)(
)(
htgtftety
dtctbtatx
5/61
Smooth Curves
Controlling the shape of the curve
321)(
)(
tttty
ttx
6/61
Smooth Curves
Controlling the shape of the curve
323)(
)(
tttty
ttx
7/61
Smooth Curves
Controlling the shape of the curve
321)(
)(
tttty
ttx
8/61
Smooth Curves
Controlling the shape of the curve
321)(
)(
tttty
ttx
9/61
Smooth Curves
Controlling the shape of the curve
321)(
)(
tttty
ttx
10/61
Smooth Curves
Controlling the shape of the curve
3231)(
)(
tttty
ttx
11/61
Smooth Curves
Controlling the shape of the curve
321)(
)(
tttty
ttx
12/61
Smooth Curves
Controlling the shape of the curve
321)(
)(
tttty
ttx
13/61
Smooth Curves
Controlling the shape of the curve
321)(
)(
tttty
ttx
Power-basis coefficients not intuitive for controlling shape of curve!!!
14/61
Interpolation
Find a polynomial y(t) such that y(ti)=yi
y
t
33
2210)( tctctccty
15/61
Interpolation
Find a polynomial y(t) such that y(ti)=yi
y
t
33
2210)( tctctccty
)(...1 2
1
0
2 ty
c
c
c
c
ttt
n
n
16/61
Interpolation
Find a polynomial y(t) such that y(ti)=yi
y
t
33
2210)( tctctccty
)(...1 2
1
0
2 ty
c
c
c
c
ttt
n
n
basis
17/61
Interpolation
Find a polynomial y(t) such that y(ti)=yi
y
t
33
2210)( tctctccty
)(...1 2
1
0
2 ty
c
c
c
c
ttt
n
n
coefficients
18/61
Interpolation
Find a polynomial y(t) such that y(ti)=yi
y
t
33
2210)( tctctccty
nn
nnnn
n
n
y
y
y
y
c
c
c
c
ttt
ttt
ttt
2
1
0
2
1
0
2
12
11
02
00
...1
...1
...1
19/61
Interpolation
Find a polynomial y(t) such that y(ti)=yi
y
t
33
2210)( tctctccty
nn
nnnn
n
n
y
y
y
y
c
c
c
c
ttt
ttt
ttt
2
1
0
2
1
0
2
12
11
02
00
...1
...1
...1
Vandermonde matrix
20/61
Interpolation
Find a polynomial y(t) such that y(ti)=yi
y
t
33
2210)( tctctccty
1
3
1
3
27931
8421
1111
0001
3
2
1
0
c
c
c
c
21/61
Interpolation
Find a polynomial y(t) such that y(ti)=yi
y
t
33
2210)( tctctccty
31
320
3
2
1
0
6
3
c
c
c
c
22/61
Interpolation
Find a polynomial y(t) such that y(ti)=yi
y
t
Intuitive control of curve using “control points”!!!
23/61
Interpolation
Perform interpolation for each component separately
Combine result to obtain parametric curve
y
x
)(),()( tytxtp
24/61
Interpolation
Perform interpolation for each component separately
Combine result to obtain parametric curve
y
x
)(),()( tytxtp
25/61
Interpolation
Perform interpolation for each component separately
Combine result to obtain parametric curve
y
x
)(),()( tytxtp
26/61
Generalized Vandermonde Matrices
Assume different basis functions fi(t)
nnnnnnn
n
n
y
y
y
y
c
c
c
c
tftftftf
tftftftf
tftftftf
2
1
0
2
1
0
210
1121110
0020100
)(...)()()(
)(...)()()(
)(...)()()(
i
ii tfcty )()(
27/61
LaGrange Polynomials
Explicit form for interpolating polynomial!
ij ji
ji tt
tttL
)(
)()(
28/61
LaGrange Polynomials
Explicit form for interpolating polynomial!
ij ji
ji tt
tttL
)(
)()(
1.5 2 2.5 3 3.5 4-0.2
0.2
0.4
0.6
0.8
1
29/61
1.5 2 2.5 3 3.5 4-0.2
0.2
0.4
0.6
0.8
1
LaGrange Polynomials
Explicit form for interpolating polynomial!
ij ji
ji tt
tttL
)(
)()(
30/61
1.5 2 2.5 3 3.5 4-0.2
0.2
0.4
0.6
0.8
1
LaGrange Polynomials
Explicit form for interpolating polynomial!
ij ji
ji tt
tttL
)(
)()(
31/61
1.5 2 2.5 3 3.5 4-0.2
0.2
0.4
0.6
0.8
1
LaGrange Polynomials
Explicit form for interpolating polynomial!
ij ji
ji tt
tttL
)(
)()(
32/61
LaGrange Polynomials
Explicit form for interpolating polynomial!
ij ji
ji tt
tttL
)(
)()(
n
iii tLyty
0
)()(
33/61
Neville’s Algorithm
Identical to matrix method but uses a geometric construction
y
t0 1 2 3
0y
1y
34/61
Neville’s Algorithm
Identical to matrix method but uses a geometric construction
y
t0 1 2 3
0y
1y
)(tf
10)1()( ytyttf
35/61
Neville’s Algorithm
Identical to matrix method but uses a geometric construction
y
t0 1 2 3
0y
1y
)(tf
10)1()( ytyttf
2y)(tg
21 )1()2()( ytyttg
36/61
Neville’s Algorithm
Identical to matrix method but uses a geometric construction
y
t0 1 2 3
0y
1y
10)1()( ytyttf
2y
)(th
21 )1()2()( ytyttg
2
)()()2()(
tgttftth
37/61
Neville’s Algorithm
Identical to matrix method but uses a geometric construction
y
t0 1 2 3
0y
1y
10)1()( ytyttf
2y
)(th
21 )1()2()( ytyttg
2
)()()2()(
tgttftth
2
)1(1)1()12()1(
gfh
38/61
Neville’s Algorithm
Identical to matrix method but uses a geometric construction
y
t0 1 2 3
0y
1y
10)1()( ytyttf
2y
)(th
21 )1()2()( ytyttg
2
)()()2()(
tgttftth
111
2)1( y
yyh
39/61
Neville’s Algorithm
Identical to matrix method but uses a geometric construction
y
t0 1 2 3
0y
1y
10)1()( ytyttf
2y
)(th
21 )1()2()( ytyttg
2
)()()2()(
tgttftth
2
)0(0)0()02()0(
gfh
40/61
Neville’s Algorithm
Identical to matrix method but uses a geometric construction
y
t0 1 2 3
0y
1y
10)1()( ytyttf
2y
)(th
21 )1()2()( ytyttg
2
)()()2()(
tgttftth
00
2
2)0( y
yh
41/61
Neville’s Algorithm
Identical to matrix method but uses a geometric construction
y
t0 1 2 3
0y
1y
10)1()( ytyttf
2y
)(th
21 )1()2()( ytyttg
2
)()()2()(
tgttftth
2
)2(2)2()22()2(
gfh
42/61
Neville’s Algorithm
Identical to matrix method but uses a geometric construction
y
t0 1 2 3
0y
1y
10)1()( ytyttf
2y
)(th
21 )1()2()( ytyttg
2
)()()2()(
tgttftth
22
2
2)2( y
yh
43/61
Neville’s Algorithm
Identical to matrix method but uses a geometric construction
y
t0 1 2 3
0y
1y
2y
)(th3y
44/61
Neville’s Algorithm
Identical to matrix method but uses a geometric construction
y
t0 1 2 3
0y
1y
2y )(tk
3y
45/61
Neville’s Algorithm
Identical to matrix method but uses a geometric construction
y
t0 1 2 3
0y
1y
2y
)(tm3y
3
)()()3()(
tktthttm
46/61
Neville’s Algorithm
0y 1y 2y 3y
01
1
tt
tt
01
0
tt
tt
12
2
tt
tt
23
3
tt
tt
12
1
tt
tt
23
2
tt
tt
)(01 ty )(12 ty )(23 ty
47/61
Neville’s Algorithm
0y 1y 2y 3y
01
1
tt
tt
01
0
tt
tt
12
2
tt
tt
23
3
tt
tt
12
1
tt
tt
23
2
tt
tt
)(01 ty )(12 ty )(23 ty
)(012 ty )(123 ty
02
0
tt
tt
02
2
tt
tt
13
3
tt
tt
13
1
tt
tt
48/61
Neville’s Algorithm
0y 1y 2y 3y
01
1
tt
tt
01
0
tt
tt
12
2
tt
tt
23
3
tt
tt
12
1
tt
tt
23
2
tt
tt
)(01 ty )(12 ty )(23 ty
)(012 ty )(123 ty
)(0123 ty
02
0
tt
tt
02
2
tt
tt
13
3
tt
tt
13
1
tt
tt
03
3
tt
tt
03
0
tt
tt
49/61
Neville’s Algorithm
Claim: The polynomial produced by Neville’s algorithm is unique
50/61
Neville’s Algorithm
Claim: The polynomial produced by Neville’s algorithm is unique
Proof: Assume that there are two degree n polynomials such that
a(ti)=b(ti)=yi for i=0…n.
)()( tbta
51/61
Neville’s Algorithm
Claim: The polynomial produced by Neville’s algorithm is unique
Proof: Assume that there are two degree n polynomials such that
a(ti)=b(ti)=yi for i=0…n.c(t)=a(t)-b(t) is also a polynomial of degree n
)()( tbta
52/61
Neville’s Algorithm
Claim: The polynomial produced by Neville’s algorithm is unique
Proof: Assume that there are two degree n polynomials such that
a(ti)=b(ti)=yi for i=0…n.c(t)=a(t)-b(t) is also a polynomial of degree n
c(t) has n+1 roots at each of the ti
)()( tbta
53/61
Neville’s Algorithm
Claim: The polynomial produced by Neville’s algorithm is unique
Proof: Assume that there are two degree n polynomials such that
a(ti)=b(ti)=yi for i=0…n.c(t)=a(t)-b(t) is also a polynomial of degree n
c(t) has n+1 roots at each of the tiPolynomials of degree n can have at most n roots!
)()( tbta
54/61
)( imiy
Hermite Interpolation
Find a polynomial y(t) that interpolates yi, yi(1), yi(2), …,
Always a unique y(t) of degree i
imn 1
55/61
)( imiy
Hermite Interpolation
Find a polynomial y(t) that interpolates yi, yi(1), yi(2), …,
Always a unique y(t) of degree i
imn 1
1
)1(1
)1(0
0
3
2
1
0
13121110
1)1(
31)1(
21)1(
11)1(
0
0)1(
30)1(
20)1(
10)1(
0
03020100
)()()()(
)()()()(
)()()()(
)()()()(
y
y
y
y
c
c
c
c
tftftftf
tftftftf
tftftftf
tftftftf
56/61
)( imiy
Hermite Interpolation
Find a polynomial y(t) that interpolates yi, yi(1), yi(2), …,
Always a unique y(t) of degree i
imn 1
1
)1(1
)1(0
0
3
2
1
0
31
211
211
200
30
200
1
3210
3210
1
y
y
y
y
c
c
c
c
ttt
tt
tt
ttt
57/61
)( imiy
Hermite Interpolation
Find a polynomial y(t) that interpolates yi, yi(1), yi(2), …,
Always a unique y(t) of degree i
imn 1
1
)1(1
)1(0
0
1
31
211
211
200
30
200
3
2
1
0
1
3210
3210
1
y
y
y
y
ttt
tt
tt
ttt
c
c
c
c
58/61
)( imiy
Hermite Interpolation
Find a polynomial y(t) that interpolates yi, yi(1), yi(2), …,
Always a unique y(t) of degree i
imn 1
1
)1(1
)1(0
0
1
31
211
211
200
30
200
32
3
2
1
0
32
1
3210
3210
1
11)(
y
y
y
y
ttt
tt
tt
ttt
ttt
c
c
c
c
tttty
59/61
)( imiy
Hermite Interpolation
Find a polynomial y(t) that interpolates yi, yi(1), yi(2), …,
Always a unique y(t) of degree i
imn 1
2
2
2
2
33
32
31
30
)23(
)1(
)1(
)21()1(
tt
tt
tt
tt
H
H
H
H
60/61
)( imiy
Hermite Interpolation
Find a polynomial y(t) that interpolates yi, yi(1), yi(2), …,
Always a unique y(t) of degree i
imn 1
61/61
)( imiy
Hermite Interpolation
Find a polynomial y(t) that interpolates yi, yi(1), yi(2), …,
Always a unique y(t) of degree i
imn 1