CSCE 441 Lecture 29

From Notes
Jump to navigation Jump to search

« previous | Monday, March 31, 2014 | next »


No class Wednesday

Smooth Curves

Represented as polynomials: p(t)=(x(t),y(t))

Power Basis

{x(t)=a+bt+ct2+dt3+y(t)=e+ft+gt2+ht3+

We can mess with coefficients, but it's hard to predict what the shape will look like just by modifiying coefficients.

Not intuitive.

Interpolation

Find a polynomial that passes through the specified values

y(t)=a+bt+ct2+dt3

y(0)=a=3y(1)=a+b+c+d=1y(2)=

Interpolate for each component x and y.


Lagrange Interpolation

Identical to matrix method, but uses a (recursive) geometric construction


Start with line from y0 to y1: f(t)=(1t)y0+ty1

Add line from y1 to y2: g(t)=(2t)y1+(t1)y2

What about quadratic?

Find linear interpolation between two points: given points t0 and t1 with values y0 and y1, respectively, the linear interpolation of y over t is given by

y(t)=(t1t)y0+(tt0)y1t1t0

In our example, h(t)=(2t)f(t)tg(t)2

What about cubic through 4 points?

  • find quadratic of first 3 points
  • find quadratic of last 3 points
  • find linear interpolation of both functions

Basis: linear interpolation between two points

Induction:

  • Assume we have points yi,,yn+1+i
  • Build polynomial interpolating polynomials f(t), g(t) of degree n for yi,,yn+1 and yi+1,,yn+1+i
  • h(t)=(n+1+it)f(t)+(ti)g(t)n+1


Problem: artifacts (oscillation) formed by pulling a single point out of line.


Bezier Curves

Polynomial curves that seek to approximate rather than interpolate.

Bernstein Polynomials

  • Degree 1: (1t), t2
  • Degree 2: (1t)2, 2(1t)t, t2
  • Degree 3: (1t)3, 3(1t)2t, 3(1t)t2, t3
  • Degree n: (ni)(it)niti for 0in.


Bezier curves are just p(t)=i=0n(ni)(1t)n1tipi for control points pi

Properties

  • Interpolates endpoints exactly
  • tangent at endpoints is in direction of first and last edge
  • curve lies within the convex hull of the control points