108
1 Dr. Scott Schaefer The Bernstein Basis and Bezier Curves

The Bernstein Basis and Bezier Curves

  • Upload
    emmett

  • View
    57

  • Download
    10

Embed Size (px)

DESCRIPTION

The Bernstein Basis and Bezier Curves. Dr. Scott Schaefer. Problems with Interpolation. Problems with Interpolation. Bezier Curves. Polynomial curves that seek to approximate rather than to interpolate. Bernstein Polynomials. Degree 1: (1- t ), t Degree 2: (1- t ) 2 , 2(1- t ) t , t 2 - PowerPoint PPT Presentation

Citation preview

Page 1: The Bernstein Basis  and Bezier Curves

1

Dr. Scott Schaefer

The Bernstein Basis and Bezier Curves

Page 2: The Bernstein Basis  and Bezier Curves

2/108

Problems with Interpolation

Page 3: The Bernstein Basis  and Bezier Curves

3/108

Problems with Interpolation

Page 4: The Bernstein Basis  and Bezier Curves

4/108

Bezier Curves

Polynomial curves that seek to approximate rather than to interpolate

Page 5: The Bernstein Basis  and Bezier Curves

5/108

Bernstein Polynomials

Degree 1: (1-t), t Degree 2: (1-t)2, 2(1-t)t, t2

Degree 3: (1-t)3, 3(1-t)2t, 3(1-t)t2, t3

Page 6: The Bernstein Basis  and Bezier Curves

6/108

Bernstein Polynomials

Degree 1: (1-t), t Degree 2: (1-t)2, 2(1-t)t, t2

Degree 3: (1-t)3, 3(1-t)2t, 3(1-t)t2, t3

Degree 4: (1-t)4, 4(1-t)3t, 6(1-t)2t2, 4(1-t)t3,t4

Page 7: The Bernstein Basis  and Bezier Curves

7/108

Bernstein Polynomials

Degree 1: (1-t), t Degree 2: (1-t)2, 2(1-t)t, t2

Degree 3: (1-t)3, 3(1-t)2t, 3(1-t)t2, t3

Degree 4: (1-t)4, 4(1-t)3t, 6(1-t)2t2, 4(1-t)t3,t4

Degree 5: (1-t)5, 5(1-t)4t, 10(1-t)3t2, 10(1-t)2t3 ,5(1-t)t4,t5

… Degree n: for iin tt

in

)1( ni 0

Page 8: The Bernstein Basis  and Bezier Curves

8/108

Properties of Bernstein Polynomials

iinni tt

in

tB

)1()(

]1,0[0)(1 ttBni

Page 9: The Bernstein Basis  and Bezier Curves

9/108

Properties of Bernstein Polynomials

iinni tt

in

tB

)1()(

]1,0[0)(1 ttBni

0)1(1 t01 t

Page 10: The Bernstein Basis  and Bezier Curves

10/108

Properties of Bernstein Polynomials

iinni tt

in

tB

)1()(

1)(0

n

i

ni tB

]1,0[0)(1 ttBni

Page 11: The Bernstein Basis  and Bezier Curves

11/108

Properties of Bernstein Polynomials

iinni tt

in

tB

)1()(

]1,0[0)(1 ttBni

1)(0

n

i

ni tB

Binomial Theorem: iinn

i

n bain

ba

0

)(

Page 12: The Bernstein Basis  and Bezier Curves

12/108

Properties of Bernstein Polynomials

iinni tt

in

tB

)1()(

]1,0[0)(1 ttBni

1)(0

n

i

ni tB

Binomial Theorem: iinn

i

n bain

ba

0

)(

iinn

i

n

i

ni tt

in

tB

)1()(

00

Page 13: The Bernstein Basis  and Bezier Curves

13/108

Properties of Bernstein Polynomials

iinni tt

in

tB

)1()(

]1,0[0)(1 ttBni

1)(0

n

i

ni tB

Binomial Theorem: iinn

i

n bain

ba

0

)(

nn

i

ni tttB

)1()(0

Page 14: The Bernstein Basis  and Bezier Curves

14/108

Properties of Bernstein Polynomials

iinni tt

in

tB

)1()(

]1,0[0)(1 ttBni

1)(0

n

i

ni tB

Binomial Theorem: iinn

i

n bain

ba

0

)(

1)(0

n

i

ni tB

Page 15: The Bernstein Basis  and Bezier Curves

15/108

Properties of Bernstein Polynomials

iinni tt

in

tB

)1()(

1)(0

n

i

ni tB

]1,0[0)(1 ttBni

)()(max]1,0[ n

ini

nit

BtB

Page 16: The Bernstein Basis  and Bezier Curves

16/108

Properties of Bernstein Polynomials

iinni tt

in

tB

)1()(

1)(0

n

i

ni tB

]1,0[0)(1 ttBni

)()(max]1,0[ n

ini

nit

BtB

0)1)(()1( 11)(

iiniin

ttB ttintti

inn

i

Page 17: The Bernstein Basis  and Bezier Curves

17/108

Properties of Bernstein Polynomials

iinni tt

in

tB

)1()(

1)(0

n

i

ni tB

]1,0[0)(1 ttBni

)()(max]1,0[ n

ini

nit

BtB

0)1)(( 11)(

iin

ttB ttnti

inn

i

Page 18: The Bernstein Basis  and Bezier Curves

18/108

Properties of Bernstein Polynomials

iinni tt

in

tB

)1()(

1)(0

n

i

ni tB

]1,0[0)(1 ttBni

)()(max]1,0[ n

ini

nit

BtB

nit

Page 19: The Bernstein Basis  and Bezier Curves

19/108

More Properties of Bernstein Polynomials )()()1()( 1

11 ttBtBttB n

ini

ni

Page 20: The Bernstein Basis  and Bezier Curves

20/108

More Properties of Bernstein Polynomials

)()()1()( 11

1 ttBtBttB ni

ni

ni

n

i

ni

jn

ji

j tBt0

)(

Page 21: The Bernstein Basis  and Bezier Curves

21/108

More Properties of Bernstein Polynomials

)()()1()( 11

1 ttBtBttB ni

ni

ni

n

i

ni

jn

ji

j tBt0

)(

n

j

jijni t

ij

jn

tB0

)1()(

Page 22: The Bernstein Basis  and Bezier Curves

22/108

More Properties of Bernstein Polynomials

)()()1()( 11

1 ttBtBttB ni

ni

ni

n

i

ni

jn

ji

j tBt0

)(

n

j

jijni t

ij

jn

tB0

)1()(

11)(

1

0 n

dttBni

Page 23: The Bernstein Basis  and Bezier Curves

23/108

Properties of Bernstein Polynomials

]1,0[1)(0 ttBni

Page 24: The Bernstein Basis  and Bezier Curves

24/108

Properties of Bernstein Polynomials

Base case:

]1,0[1)(0 ttBni

1)(01 1 tBn i

Page 25: The Bernstein Basis  and Bezier Curves

25/108

Properties of Bernstein Polynomials

Base case:

]1,0[1)(0 ttBni

1)(01 1 tBn i

101)1(0 tt

Page 26: The Bernstein Basis  and Bezier Curves

26/108

Properties of Bernstein Polynomials

Base case:

Inductive Step: Assume

]1,0[1)(0 ttBni

1)(01 1 tBn i

101)1(0 tt

]1,0[1)(0 1 ttBni

Page 27: The Bernstein Basis  and Bezier Curves

27/108

Properties of Bernstein Polynomials

Base case:

Inductive Step: Assume

]1,0[1)(0 ttBni

1)(01 1 tBn i

101)1(0 tt

]1,0[1)(0 1 ttBni

)()()1()( 11

1 ttBtBttB ni

ni

ni

Page 28: The Bernstein Basis  and Bezier Curves

28/108

Properties of Bernstein Polynomials

Base case:

Inductive Step: Assume

]1,0[1)(0 ttBni

1)(01 1 tBn i

101)1(0 tt

]1,0[1)(0 1 ttBni

)()()1()( 11

1 ttBtBttB ni

ni

ni

1)()()1(0 11

1

ttBtBt ni

ni

Page 29: The Bernstein Basis  and Bezier Curves

29/108

Properties of Bernstein Polynomials

Base case:

Inductive Step: Assume

]1,0[1)(0 ttBni

1)(01 1 tBn i

101)1(0 tt

]1,0[1)(0 1 ttBni

)()()1()( 11

1 ttBtBttB ni

ni

ni

1)()()1(0 11

1

ttBtBt ni

ni

1)(0 tBni

Page 30: The Bernstein Basis  and Bezier Curves

30/108

Bezier Curves

n

ii

iin pttin

tp0

)1()(

Page 31: The Bernstein Basis  and Bezier Curves

31/108

Bezier Curves

n

ii

iin pttin

tp0

)1()(

)1,0()1,1()1(3)0,1()1(3)0,0()1()( 3223 tttttttp

Page 32: The Bernstein Basis  and Bezier Curves

32/108

Bezier Curves

n

ii

iin pttin

tp0

)1()(

))23(,)1(3()( 2tttttp

Page 33: The Bernstein Basis  and Bezier Curves

33/108

Bezier Curve Properties

Interpolate end-points

n

ii

iin pttin

tp0

)1()(

Page 34: The Bernstein Basis  and Bezier Curves

34/108

Bezier Curve Properties

Interpolate end-points

00

0)01()0( ppin

pn

ii

iin

Page 35: The Bernstein Basis  and Bezier Curves

35/108

Bezier Curve Properties

Interpolate end-points

n

n

ii

iin ppin

p

0

1)11()1(

Page 36: The Bernstein Basis  and Bezier Curves

36/108

Bezier Curve Properties

Interpolate end-points

n

n

ii

iin ppin

p

0

1)11()1(

Page 37: The Bernstein Basis  and Bezier Curves

37/108

Bezier Curve Properties

Interpolate end-points Tangent at end-points in direction of first/last

edge

n

ii

iin pttin

tp0

)1()(

Page 38: The Bernstein Basis  and Bezier Curves

38/108

Bezier Curve Properties

Interpolate end-points Tangent at end-points in direction of first/last

edge

n

i

iiniini

n

ii

iin ttinttipin

pttin

tttp

0

11

0

)1)(()1()1()(

Page 39: The Bernstein Basis  and Bezier Curves

39/108

Bezier Curve Properties

Interpolate end-points Tangent at end-points in direction of first/last

edge

n

i

iiniini

n

ii

iin ttinttipin

pttin

tttp

0

11

0

)1)(()1()1()(

1

0

1

1

1 )1)(()1()( n

i

iini

n

i

iini ttinp

in

ttipin

ttp

Page 40: The Bernstein Basis  and Bezier Curves

40/108

Bezier Curve Properties

Interpolate end-points Tangent at end-points in direction of first/last

edge

n

i

iiniini

n

ii

iin ttinttipin

pttin

tttp

0

11

0

)1)(()1()1()(

1

0

1

1

1 )1)(()1()( n

i

iini

n

i

iini ttinp

in

ttipin

ttp

1

0

1

1

11 )()()( n

i

nii

n

i

nii tBpntBpn

ttp

Page 41: The Bernstein Basis  and Bezier Curves

41/108

Bezier Curve Properties

Interpolate end-points Tangent at end-points in direction of first/last

edge

n

i

iiniini

n

ii

iin ttinttipin

pttin

tttp

0

11

0

)1)(()1()1()(

1

0

1

1

1 )1)(()1()( n

i

iini

n

i

iini ttinp

in

ttipin

ttp

1

0

11

1

0

11

0

11 )()()()()( n

i

niii

n

i

nii

n

i

nii tBppntBpntBpn

ttp

1

0

1

1

11 )()()( n

i

nii

n

i

nii tBpntBpn

ttp

Page 42: The Bernstein Basis  and Bezier Curves

42/108

Bezier Curve Properties

Interpolate end-points Tangent at end-points in direction of first/last

edge

n

i

iiniini

n

ii

iin ttinttipin

pttin

tttp

0

11

0

)1)(()1()1()(

1

0

1

1

1 )1)(()1()( n

i

iini

n

i

iini ttinp

in

ttipin

ttp

Another Bezier curve of vectors!!!

1

0

11

1

0

11

0

11 )()()()()( n

i

niii

n

i

nii

n

i

nii tBppntBpntBpn

ttp

1

0

1

1

11 )()()( n

i

nii

n

i

nii tBpntBpn

ttp

Page 43: The Bernstein Basis  and Bezier Curves

43/108

Bezier Curve Properties

Interpolate end-points Tangent at end-points in direction of first/last

edge

)()0(01 ppn

tp

)()1(1

nn ppnt

p

Page 44: The Bernstein Basis  and Bezier Curves

44/108

Bezier Curve Properties

Interpolate end-points Tangent at end-points in direction of first/last

edge Curve lies within the convex hull of the

control points

Page 45: The Bernstein Basis  and Bezier Curves

45/108

Bezier Curve Properties

Interpolate end-points Tangent at end-points in direction of first/last

edge Curve lies within the convex hull of the

control points Bezier Lagrange

Page 46: The Bernstein Basis  and Bezier Curves

46/108

Matrix Form of Bezier Curves

n

ii

ni ptBtp

0

)()(

Page 47: The Bernstein Basis  and Bezier Curves

47/108

Matrix Form of Bezier Curves

n

ii

ni ptBtp

0

)()(

)(

)()(

0

0

tB

tBpptp

nn

n

n

Page 48: The Bernstein Basis  and Bezier Curves

48/108

Matrix Form of Bezier Curves

n

ii

ni ptBtp

0

)()(

nnnn

n

n

tmm

mmpptp

1)(

0

000

0

ij

jn

m ijij )1(

Page 49: The Bernstein Basis  and Bezier Curves

49/108

Matrix Form of Bezier Curves

n

ii

ni ptBtp

0

)()(

nnnn

n

n

tmm

mmpptp

1)(

0

000

0

10003300

36301331

M

Page 50: The Bernstein Basis  and Bezier Curves

50/108

Matrix Form of Bezier Curves

n

ii

ni ptBtp

0

)()(

nnnn

n

n

tmm

mmpptp

1)(

0

000

0

10003300

36301331

M

Computation in monomial basis is unstable!!!

Most proofs/computations are easier in Bernstein basis!!!

Page 51: The Bernstein Basis  and Bezier Curves

51/108

Change of Basis

111n

0p 1p 2p 3p

111 n

111 n

111n

111 n

111n

221 n

221n

221 n

221n

331 n

331n

Bezier coefficients

Page 52: The Bernstein Basis  and Bezier Curves

52/108

Change of Basis

111n

0p 1p 2p 3p

111 n

111 n

111n

111 n

111n

221 n

221n

221 n

221n

331 n

331n

Coefficients in monomial basis!!!

jjn 1

Bezier coefficients

Page 53: The Bernstein Basis  and Bezier Curves

53/108

Change of Basis

n

ii

ni

n

ii

i ptBat00

)(

Page 54: The Bernstein Basis  and Bezier Curves

54/108

Change of Basis

n

ii

ni

n

ii

i ptBat00

)(

10

000

01

0

11

nnnn

n

nn

n

tmm

mmpp

taa

Page 55: The Bernstein Basis  and Bezier Curves

55/108

Change of Basis

n

ii

ni

n

ii

i ptBat00

)(

nnn

n

nn

mm

mmppaa

0

000

00

Page 56: The Bernstein Basis  and Bezier Curves

56/108

Change of Basis

n

ii

ni

n

ii

i ptBat00

)(

n

nnn

n

n ppmm

mmaa

0

1

0

000

0

Page 57: The Bernstein Basis  and Bezier Curves

57/108

Change of Basis

111n

0a 1a 2a 3a

1 1 1

1 1

1

monomial coefficients

111n

212n

212n 31

3n

111n

Page 58: The Bernstein Basis  and Bezier Curves

58/108

Change of Basis

111n1 1 21

2n 1 31

3n

1 1

1

monomial coefficients

111n

111n

212n

Coefficients in Bezier basis!!!

jnj1

0a 1a 2a 3a

Page 59: The Bernstein Basis  and Bezier Curves

59/108

Degree Elevation

Power basis is trivial: add 0 tn+1

What about Bezier basis?

1

0

1

0

)(ˆ)(n

j

njj

n

i

nii tBptBp

Page 60: The Bernstein Basis  and Bezier Curves

60/108

Degree Elevation

1

0

1

0

)(ˆ)(n

j

njj

n

i

nii tBptBp

n

i

niii

n

i

nii tBptpttBp

00

)())1(()(

Page 61: The Bernstein Basis  and Bezier Curves

61/108

Degree Elevation

1

0

1

0

)(ˆ)(n

j

njj

n

i

nii tBptBp

n

i

niii

n

i

nii tBptpttBp

00

)())1(()(

n

i

nin

ii

n

i

nin

ini tBptBp

0

111

1

0

11

1 )()(

Page 62: The Bernstein Basis  and Bezier Curves

62/108

Degree Elevation

1

0

1

0

)(ˆ)(n

j

njj

n

i

nii tBptBp

n

i

niii

n

i

nii tBptpttBp

00

)())1(()(

n

i

nin

ii

n

i

nin

ini tBptBp

0

111

1

0

11

1 )()(

1

0

111

1

0

11

1 )()(n

i

nin

ii

n

i

nin

ini tBptBp

Page 63: The Bernstein Basis  and Bezier Curves

63/108

Degree Elevation

1

0

1

0

)(ˆ)(n

j

njj

n

i

nii tBptBp

n

i

niii

n

i

nii tBptpttBp

00

)())1(()(

n

i

nin

ii

n

i

nin

ini tBptBp

0

111

1

0

11

1 )()(

1

0

111

1

0

11

1 )()(n

i

nin

ii

n

i

nin

ini tBptBp

1

0

1111 )(1

n

i

nin

iin

ii tBpp

Page 64: The Bernstein Basis  and Bezier Curves

64/108

Degree Elevation

Page 65: The Bernstein Basis  and Bezier Curves

65/108

Degree Elevation

1

Page 66: The Bernstein Basis  and Bezier Curves

66/108

Degree Elevation

41

43

Page 67: The Bernstein Basis  and Bezier Curves

67/108

Degree Elevation

21

21

Page 68: The Bernstein Basis  and Bezier Curves

68/108

Degree Elevation

41

43

Page 69: The Bernstein Basis  and Bezier Curves

69/108

Degree Elevation

1

Page 70: The Bernstein Basis  and Bezier Curves

70/108

Degree Elevation

Page 71: The Bernstein Basis  and Bezier Curves

71/108

Pyramid Algorithms for Bezier Curves Polynomials aren’t pretty Is there an easier way to evaluate the

equation of a Bezier curve?

n

ii

iin pttin

tp0

)1()(

Page 72: The Bernstein Basis  and Bezier Curves

72/108

Pyramid Algorithms forBezier Curves

0p 1p 2p 3p

21)1( ptpt 10)1( ptpt 32)1( ptpt

t1 t1 t1t tt

Page 73: The Bernstein Basis  and Bezier Curves

73/108

Pyramid Algorithms forBezier Curves

0p 1p 2p 3p

22

102 )1(2)1( ptpttpt

t1 t1 t1t tt

t1 t t1 t

32

212 )1(2)1( ptpttpt

Page 74: The Bernstein Basis  and Bezier Curves

74/108

Pyramid Algorithms forBezier Curves

0p 1p 2p 3p

t1 t1 t1t tt

t1 t t1 t

33

22

12

03 )1(3)1(3)1( ptpttpttpt

t1 t

Page 75: The Bernstein Basis  and Bezier Curves

75/108

Pyramid Algorithms forDerivatives of Bezier Curves

0p 1p 2p 3p

1 1 11 11

t1 t t1 t

)(' tp

t1 tTake derivative of any level of pyramid!!!(up to constant multiple)

Page 76: The Bernstein Basis  and Bezier Curves

76/108

Pyramid Algorithms forDerivatives of Bezier Curves

0p 1p 2p 3p

t1 t t1 t

)(' tp

1 1Take derivative of any level of pyramid!!!(up to constant multiple)

t1 t1 t1t tt

Page 77: The Bernstein Basis  and Bezier Curves

77/108

Subdividing Bezier Curves

Given a single Bezier curve, construct two smaller Bezier curves whose union is exactly the original curve

Page 78: The Bernstein Basis  and Bezier Curves

78/108

Subdividing Bezier Curves

Given a single Bezier curve, construct two smaller Bezier curves whose union is exactly the original curve

Page 79: The Bernstein Basis  and Bezier Curves

79/108

Subdividing Bezier Curves

Given a single Bezier curve, construct two smaller Bezier curves whose union is exactly the original curve

Page 80: The Bernstein Basis  and Bezier Curves

80/108

Subdividing Bezier Curves

Given a single Bezier curve, construct two smaller Bezier curves whose union is exactly the original curve

Page 81: The Bernstein Basis  and Bezier Curves

81/108

Subdividing Bezier Curves

Given a single Bezier curve, construct two smaller Bezier curves whose union is exactly the original curve

Page 82: The Bernstein Basis  and Bezier Curves

82/108

Subdividing Bezier Curves

0p 1p 2p 3p

t1 t1 t1t tt

t1 t t1 t

t1 tControl points for left curve!!!

Page 83: The Bernstein Basis  and Bezier Curves

83/108

Subdividing Bezier Curves

0p 1p 2p 3p

t1 t1 t1t tt

t1 t t1 t

t1 t Control points for right curve!!!

Page 84: The Bernstein Basis  and Bezier Curves

84/108

Subdividing Bezier Curves

0p 1p 2p 3p

21

21

21

21

21

21

21

21

21

21

21

21

121

021 pp 22

112

1 pp 321

221 pp

241

121

041 ppp 34

122

114

1 ppp

381

283

183

081 pppp

Page 85: The Bernstein Basis  and Bezier Curves

85/108

Variation Diminishing

Intuitively means that the curve “wiggles” no more than its control polygon

Page 86: The Bernstein Basis  and Bezier Curves

86/108

Variation Diminishing

Intuitively means that the curve “wiggles” no more than its control polygon

Lagrange Interpolation

Page 87: The Bernstein Basis  and Bezier Curves

87/108

Variation Diminishing

Intuitively means that the curve “wiggles” no more than its control polygon

Bezier Curve

Page 88: The Bernstein Basis  and Bezier Curves

88/108

Variation Diminishing

For any line, the number of intersections with the control polygon is greater than or equal to the number of intersections with the curve

Bezier Curve

Page 89: The Bernstein Basis  and Bezier Curves

89/108

Variation Diminishing

For any line, the number of intersections with the control polygon is greater than or equal to the number of intersections with the curve

Bezier Curve

Page 90: The Bernstein Basis  and Bezier Curves

90/108

Variation Diminishing

For any line, the number of intersections with the control polygon is greater than or equal to the number of intersections with the curve

Bezier Curve

Page 91: The Bernstein Basis  and Bezier Curves

91/108

Variation Diminishing

For any line, the number of intersections with the control polygon is greater than or equal to the number of intersections with the curve

Bezier Curve

Page 92: The Bernstein Basis  and Bezier Curves

92/108

Variation Diminishing

For any line, the number of intersections with the control polygon is greater than or equal to the number of intersections with the curve

Bezier Curve

Page 93: The Bernstein Basis  and Bezier Curves

93/108

Variation Diminishing

For any line, the number of intersections with the control polygon is greater than or equal to the number of intersections with the curve

Lagrange Interpolation

Page 94: The Bernstein Basis  and Bezier Curves

94/108

Applications: Intersection

Given two Bezier curves, determine if and where they intersect

Page 95: The Bernstein Basis  and Bezier Curves

95/108

Applications: Intersection

Check if convex hulls intersect If not, return no intersection If both convex hulls can be approximated

with a straight line, intersect lines and return intersection

Otherwise subdivide and recur on subdivided pieces

Page 96: The Bernstein Basis  and Bezier Curves

96/108

Applications: Intersection

Page 97: The Bernstein Basis  and Bezier Curves

97/108

Applications: Intersection

Page 98: The Bernstein Basis  and Bezier Curves

98/108

Applications: Intersection

Page 99: The Bernstein Basis  and Bezier Curves

99/108

Applications: Intersection

Page 100: The Bernstein Basis  and Bezier Curves

100/108

Applications: Intersection

Page 101: The Bernstein Basis  and Bezier Curves

101/108

Applications: Intersection

Page 102: The Bernstein Basis  and Bezier Curves

102/108

Applications: Intersection

Page 103: The Bernstein Basis  and Bezier Curves

103/108

Applications: Intersection

Page 104: The Bernstein Basis  and Bezier Curves

104/108

Applications: Intersection

Page 105: The Bernstein Basis  and Bezier Curves

105/108

Applications: Intersection

Page 106: The Bernstein Basis  and Bezier Curves

106/108

Applications: Intersection

Page 107: The Bernstein Basis  and Bezier Curves

107/108

Application: Font Rendering

Page 108: The Bernstein Basis  and Bezier Curves

108/108

Application: Font Rendering