61
1 Dr. Scott Schaefer Curves and Interpolation

1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

  • View
    228

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

1

Dr. Scott Schaefer

Curves and Interpolation

Page 2: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

2/61

Smooth Curves

How do we create smooth curves?

Page 3: 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

Page 4: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

4/61

Smooth Curves

Controlling the shape of the curve

32

32

)(

)(

htgtftety

dtctbtatx

Page 5: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

5/61

Smooth Curves

Controlling the shape of the curve

321)(

)(

tttty

ttx

Page 6: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

6/61

Smooth Curves

Controlling the shape of the curve

323)(

)(

tttty

ttx

Page 7: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

7/61

Smooth Curves

Controlling the shape of the curve

321)(

)(

tttty

ttx

Page 8: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

8/61

Smooth Curves

Controlling the shape of the curve

321)(

)(

tttty

ttx

Page 9: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

9/61

Smooth Curves

Controlling the shape of the curve

321)(

)(

tttty

ttx

Page 10: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

10/61

Smooth Curves

Controlling the shape of the curve

3231)(

)(

tttty

ttx

Page 11: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

11/61

Smooth Curves

Controlling the shape of the curve

321)(

)(

tttty

ttx

Page 12: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

12/61

Smooth Curves

Controlling the shape of the curve

321)(

)(

tttty

ttx

Page 13: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

13/61

Smooth Curves

Controlling the shape of the curve

321)(

)(

tttty

ttx

Power-basis coefficients not intuitive for controlling shape of curve!!!

Page 14: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

14/61

Interpolation

Find a polynomial y(t) such that y(ti)=yi

y

t

33

2210)( tctctccty

Page 15: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 16: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 17: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 18: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 19: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 20: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 21: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 22: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

22/61

Interpolation

Find a polynomial y(t) such that y(ti)=yi

y

t

Intuitive control of curve using “control points”!!!

Page 23: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

23/61

Interpolation

Perform interpolation for each component separately

Combine result to obtain parametric curve

y

x

)(),()( tytxtp

Page 24: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

24/61

Interpolation

Perform interpolation for each component separately

Combine result to obtain parametric curve

y

x

)(),()( tytxtp

Page 25: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

25/61

Interpolation

Perform interpolation for each component separately

Combine result to obtain parametric curve

y

x

)(),()( tytxtp

Page 26: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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 )()(

Page 27: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

27/61

LaGrange Polynomials

Explicit form for interpolating polynomial!

ij ji

ji tt

tttL

)(

)()(

Page 28: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 29: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

)(

)()(

Page 30: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

)(

)()(

Page 31: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

)(

)()(

Page 32: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

32/61

LaGrange Polynomials

Explicit form for interpolating polynomial!

ij ji

ji tt

tttL

)(

)()(

n

iii tLyty

0

)()(

Page 33: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

33/61

Neville’s Algorithm

Identical to matrix method but uses a geometric construction

y

t0 1 2 3

0y

1y

Page 34: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 35: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 36: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 37: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 38: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 39: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 40: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 41: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 42: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 43: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

43/61

Neville’s Algorithm

Identical to matrix method but uses a geometric construction

y

t0 1 2 3

0y

1y

2y

)(th3y

Page 44: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

44/61

Neville’s Algorithm

Identical to matrix method but uses a geometric construction

y

t0 1 2 3

0y

1y

2y )(tk

3y

Page 45: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 46: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 47: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 48: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 49: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

49/61

Neville’s Algorithm

Claim: The polynomial produced by Neville’s algorithm is unique

Page 50: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 51: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 52: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 53: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 54: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 55: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 56: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 57: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 58: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 59: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 60: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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

Page 61: 1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?

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