1 / 6

Lecture 07: Splines

Lecture 07: Splines. February 12, 2013 COMP 150-2 Visualization. Cubic Splines. General form of a cubic spline: q(t) = a + bt * ct^2 + dt^3 q’(t) = b + 2ct + 3dt^2 Given: q(0) = S (starting point) q’(0) = Vs (velocity at point S) q(1) = G (goal point)

drew
Télécharger la présentation

Lecture 07: Splines

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 07:Splines February 12, 2013 COMP 150-2Visualization

  2. Cubic Splines • General form of a cubic spline: • q(t) = a + bt * ct^2 + dt^3 • q’(t) = b + 2ct + 3dt^2 • Given: • q(0) = S (starting point) • q’(0) = Vs (velocity at point S) • q(1) = G (goal point) • q’(1) = Vg (velocity at end point G)

  3. Cubic Spline • Plug in the numbers: • q(0) = a + b(0) + c(0) + d(0) = S • => a = S • q’(0) = b + 2c(0) + 3d(0) = Vs • => b = Vs • Two remaining variables (c, d), two equations. Solve for c and d: • q(1) = a + b(1) + c(1) + d(1) = G • q’(1) = b + 2c + 3d = Vg

  4. Cubic Spline • Plug in a = S, and b = Vs • q(1) = S + Vs + c + d = G ---- (eq1) • q’(1) = Vs + 2c + 3d = Vg ---- (eq2) • Solve for c first, (eq1)*3 – (eq2) • => c = -3S + 3G – 2Vs – 2Vg • Solve for d, (eq2) – ((eq1) * 2) • => d = 2S – 2G + Vs + Vg

  5. Cubic Spline • Putting it all together: • q(t) = ( 1S + 0G + 0Vs + 0Vg) + • ( 0S + 0G + 1Vs + 0Vg) * t + • (-3S + 3G - 2Vs - 1Vg) * t * t + • ( 2S - 2G + 1Vs + 1Vg) * t * t * t • Test this by plugging in t = 0 and t = 1

  6. Questions?

More Related