Cubic Spline Interpolation. Cubic Splines attempt to solve the problem of the smoothness of a graph as well as reduce error. Polynomial interpolation.

Slides:



Advertisements
Similar presentations
Arc-length computation and arc-length parameterization
Advertisements

Remember: Derivative=Slope of the Tangent Line.
Polynomial Approximation PSCI 702 October 05, 2005.
Equations of Tangent Lines
Interpolation A method of constructing a function that crosses through a discrete set of known data points. .
Cubic Curves CSE167: Computer Graphics Instructor: Steve Rotenberg UCSD, Fall 2006.
CS 445/645 Fall 2001 Hermite and Bézier Splines. Specifying Curves Control Points –A set of points that influence the curve’s shape Knots –Control points.
Chapter 18 Interpolation The Islamic University of Gaza
1 Chapter 4 Interpolation and Approximation Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation.
1 Curve-Fitting Spline Interpolation. 2 Curve Fitting Regression Linear Regression Polynomial Regression Multiple Linear Regression Non-linear Regression.
Dr. S.M. Malaek Assistant: M. Younesi
Slide 127 October 1999CS Computer Graphics (Top Changwatchai) Review of Spline Concepts Sections 10-6 to in Hearn & Baker Splines can be 2D.
Lecture 29 of 42 Bezier Curves and Splines Wednesday, 02 April 2008
P. Brigger, J. Hoeg, and M. Unser Presented by Yu-Tseh Chi.
Finding Zeros Given the Graph of a Polynomial Function Chapter 5.6.
Rational Bezier Curves
1cs426-winter-2008 Notes  Ian Mitchell is running a MATLAB tutorial, Tuesday January 15, 5pm-7pm, DMP 110 We won’t be directly using MATLAB in this course,
Modeling of curves Needs a ways of representing curves: Reproducible - the representation should give the same curve every time; Computationally Quick;
1cs426-winter-2008 Notes  Assignment 0 is due today  MATLAB tutorial tomorrow 5-7 if you’re interested (see web-page for link)
1 Dr. Scott Schaefer Catmull-Rom Splines: Combining B-splines and Interpolation.
Bezier and Spline Curves and Surfaces Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Modelling: Curves Week 11, Wed Mar 23
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 23 CURVE FITTING Chapter 18 Function Interpolation and Approximation.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 24 Regression Analysis-Chapter 17.
RASTER CONVERSION ALGORITHMS FOR CURVES: 2D SPLINES 2D Splines - Bézier curves - Spline curves.
Bezier and Spline Curves and Surfaces CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Solving a System of Equations by ELIMINATION. Elimination Solving systems by Elimination: 1.Line up like terms in standard form x + y = # (you may have.
Using Inverse Matrices Solving Systems. You can use the inverse of the coefficient matrix to find the solution. 3x + 2y = 7 4x - 5y = 11 Solve the system.
CS 376 Introduction to Computer Graphics 04 / 23 / 2007 Instructor: Michael Eckmann.
Scientific Computing Linear and Quadratic Splines.
Simpson Rule For Integration.
(Spline, Bezier, B-Spline)
4.4 & 4.5 Notes Remember: Identity Matrices: If the product of two matrices equal the identity matrix then they are inverses.
Using Matrices to Solve Systems of Equations Matrix Equations l We have solved systems using graphing, but now we learn how to do it using matrices.
Curves.
Vector Computer Graphic. Vector entities Line Circle, Ellipse, arc,… Curves: Spline, Bezier’s curve, … … Areas Solids Models.
Objectives Identify the multiplicity of roots Use the Rational Root Theorem and the Irrational Root Theorem to solve polynomial equations.
INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve.
Lecture 16 - Approximation Methods CVEN 302 July 15, 2002.
Jump to first page Chapter 3 Splines Definition (3.1) : Given a function f defined on [a, b] and a set of numbers, a = x 0 < x 1 < x 2 < ……. < x n = b,
Introduction to Numerical Analysis I MATH/CMPSC 455 Splines.
CS 376 Introduction to Computer Graphics 04 / 25 / 2007 Instructor: Michael Eckmann.
Solving Systems of Equations: The Elimination Method Solving Systems of Equations: The Elimination Method Solving Systems of Equations: The Elimination.
L5 – Curves in GIS NGEN06 & TEK230: Algorithms in Geographical Information Systems by: Sadegh Jamali (source: Lecture notes in GIS, Lars Harrie) 1 L5-
Curves: ch 4 of McConnell General problem with constructing curves: how to create curves that are “smooth” CAD problem Curves could be composed of segments.
Spline Interpolation A Primer on the Basics by Don Allen.
Solving Equations Binomials Simplifying Polynomials
Slide 129 October 1999CS Computer Graphics (Top Changwatchai) Bézier Curves - Results of Derivation Tangents at endpoints are equal to endpoint slopes.
Classification GraphAlgebra Solution InconsistentParallel ( same slope, different y- int) 0=#No solution Consistent Dependent Same line Same slope, same.
 3.3 Hermite Interpolation Chapter 3 Interpolation and Polynomial Approximation -- Hermite Interpolation Find the osculating polynomial P(x) such that.
By: Mark Coose Joetta Swift Micah Weiss. What Problems Can Interpolation Solve? Given a table of values, find a simple function that passes through the.
CS 325 Computer Graphics 04 / 30 / 2010 Instructor: Michael Eckmann.
1 Chapter 4 Interpolation and Approximation Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation.
Curves University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner.
CS552: Computer Graphics Lecture 19: Bezier Curves.
Object Modeling: Curves and Surfaces CEng 477 Introduction to Computer Graphics.
Solving a System of Equations by ELIMINATION. Elimination Solving systems by Elimination: 1.Line up like terms in standard form x + y = # (you may have.
Introduction to Parametric Curve and Surface Modeling.
Interpolation - Introduction
(Spline, Bezier, B-Spline)
Chapter 10-2: Curves.
The Inverse of a Square Matrix
Curve-Fitting Spline Interpolation
Solving Polynomial Functions
6-3 Solving Systems Using Elimination
Spline Interpolation Class XVII.
Solving Polynomial Equations
MATH 174: Numerical Analysis I
Splines There are cases where polynomial interpolation is bad
Introduction to Parametric Curve and Surface Modeling
Presentation transcript:

Cubic Spline Interpolation

Cubic Splines attempt to solve the problem of the smoothness of a graph as well as reduce error. Polynomial interpolation uses a single polynomial to meet all data points, while splines use several low degree polynomials. Cubic splines consist of polynomials of degree 3. Cubic splines add curvature to an interpolation that would otherwise be only line segments.

Base points for cubic splines are called knots. Every sections of a spline begins and ends with a knot. A natural cubic spline also fulfills the conditions: S’’ 1 (x 1 ) = 0 and S’’ n-1 (x n ) = 0. In other words, both endpoints 2 nd derivative must be 0.

Splines are made up of the equations: – S 1 (x) = y 1 + b 1 (x - x 1 ) + c 1 (x - x 1 ) ^2 + d 1 (x - x 1 ) ^3 – S 2 (x) = y 2 + b 2 (x - x 2 ) + c 2 (x - x 2 ) ^2 + d 2 (x - x 2 ) ^3 – … – S n-1 (x) = y n-1 + b n-1 (x - x n-1 ) + c n-1 (x – x n-1 ) ^2 + dn-1(x – x n- 1 )^3 With the following properties: S i (x i ) = y i and S i (x i+1 ) = y i+1 for i = 1,…,n - 1 – Guarantees that the spline interpolates the data points S’ i-1 (x i ) = S’ i (x i ) for i = 2,…,n - 1 – Forces the slopes of the parts of the spline to meet S’’ i-1 (x i ) = S’’ i (x i ) for i = 2,…,n - 1 – Forces the curvature to agree

So what we are looking to solve are the coefficients of the cubic spline, a,b,c,d. To solve for these, we use the formula: – S i (x) = y i + b i (x – x i ) + c i (x – x i ) ^2 + d i (x – x i ) ^3 for n – 1 equations, where n = number of points. The following finds the coefficients for the equation: – a i = y i – δ i = x i+1 - x i – Δ i = y i+1 - y i – d i = (c i+1 – c i ) / 3δ i – b i = Δ i / δ i - δ i / 3 (2c i + c i+1 )

To find c, we need to first make an nxn matrix with n solutions of c. We also need to make a vector of c values as well as a vector that they equal to. The first and last rows are always of this form. Remember: δ i = x i+1 - x i

C1C1 C2C2 C3C3 … CnCn This is our vector of c values. 0 3(Δ 2 / δ 2 – Δ 1 / δ 1 ) … 3(Δ n-1 / δ n-1 – Δ n-2 / δ n-2 0 This is the vector that they are set equal to. The first and last rows are always 0. To solve c, we multiply the inverse of the matrix that we created with the vector that we created. 100…… δ1δ1 2δ 1 + 2δ 2 δ2δ2 0… 0δ2δ2 2δ 2 + 2δ 3 δ3δ3 … 00……… …0001 C1C1 C2C2 C3C3 … CnCn 0 3(Δ 2 / δ 2 – Δ 1 / δ 1 ) … 3(Δ n-1 / δ n-1 – Δ n-2 / δ n-2 0 =

When multiplied together we get a vector of c values. We now plug in the c values to solve for the b and d values. – d i = (c i+1 – c i ) / 3δ i – b i = Δ i / δ i - δ i / 3 (2c i + c i+1 ) 100…… δ1δ1 2δ 1 + 2δ 2 δ2δ2 0… 0δ2δ2 2δ 2 + 2δ 3 δ3δ3 … 00……… …0001 C1C1 C2C2 C3C3 … CnCn 0 3(Δ 2 / δ 2 – Δ 1 / δ 1 ) … 3(Δ n-1 / δ n-1 – Δ n-2 / δ n-2 0 =

We now plug in all of our values into our equation to find the n-1 equations for our cubic spline. S 1 (x) = y 1 + b 1 (x - x 1 ) + c 1 (x - x 1 ) ^2 + d 1 (x - x 1 ) ^3 S 2 (x) = y 2 + b 2 (x - x 2 ) + c 2 (x - x 2 ) ^2 + d 2 (x - x 2 ) ^3 … S n-1 (x) = y n-1 + b n-1 (x - x n-1 ) + c n-1 (x – x n-1 ) ^2 + dn-1(x – x n-1 ) ^3

Advantages: Algorithm is much quicker and more accurate than other spline algorithms of lesser degrees. Easy to create and produces a seemingly seamless curve. Disadvantages Applications sensitive to the smoothness of derivatives higher than second degree may give an undesired result

References 0/handouts/cubic_spline/cubic_spline/node1. html