Review of Interpolation. A method of constructing a function that crosses through a discrete set of known data points.

Slides:



Advertisements
Similar presentations
COMPUTER GRAPHICS CS 482 – FALL 2014 OCTOBER 8, 2014 SPLINES CUBIC CURVES HERMITE CURVES BÉZIER CURVES B-SPLINES BICUBIC SURFACES SUBDIVISION SURFACES.
Advertisements

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.
ICS 415 Computer Graphics Bézier Splines (Chapter 8)
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.
Selected from presentations by Jim Ramsay, McGill University, Hongliang Fei, and Brian Quanz Basis Basics.
CS 445 / 645 Introduction to Computer Graphics Lecture 22 Hermite Splines Lecture 22 Hermite Splines.
1 Introduction Curve Modelling Jack van Wijk TU Eindhoven.
1 Curve-Fitting Spline Interpolation. 2 Curve Fitting Regression Linear Regression Polynomial Regression Multiple Linear Regression Non-linear Regression.
1 Curves and Surfaces. 2 Representation of Curves & Surfaces Polygon Meshes Parametric Cubic Curves Parametric Bi-Cubic Surfaces Quadric Surfaces Specialized.
Bezier Curves and Splines David Eno MAT 499 Fall ‘06.
Slide 127 October 1999CS Computer Graphics (Top Changwatchai) Review of Spline Concepts Sections 10-6 to in Hearn & Baker Splines can be 2D.
Informationsteknologi Monday, December 10, 2007Computer Graphics - Class 161 Today’s class Curve fitting Evaluators Surfaces.
Modeling of curves Needs a ways of representing curves: Reproducible - the representation should give the same curve every time; Computationally Quick;
1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution.
Designing Parametric Cubic Curves Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
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
RASTER CONVERSION ALGORITHMS FOR CURVES: 2D SPLINES 2D Splines - Bézier curves - Spline curves.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Curves Week 13, Mon 24 Nov 2003.
Bezier and Spline Curves and Surfaces CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Designing Parametric Cubic Curves
1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided.
Splines III – Bézier Curves
Computer Graphics Lecture 13 Curves and Surfaces I.
Curve Modeling Bézier Curves
CS 376 Introduction to Computer Graphics 04 / 23 / 2007 Instructor: Michael Eckmann.
Interactive Graphics Lecture 9: Slide 1 Interactive Graphics Lecture 9: Introduction to Spline Curves.
Scientific Computing Linear and Quadratic Splines.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
V. Space Curves Types of curves Explicit Implicit Parametric.
Introduction to Computer Graphics with WebGL
Numerical Computation
CS 445 / 645 Introduction to Computer Graphics Lecture 23 Bézier Curves Lecture 23 Bézier Curves.
Vector Computer Graphic. Vector entities Line Circle, Ellipse, arc,… Curves: Spline, Bezier’s curve, … … Areas Solids Models.
1 Interpolation. 2 What is Interpolation ? Given (x 0,y 0 ), (x 1,y 1 ), …… (x n,y n ), find the value of ‘y’ at a.
Quadratic Surfaces. SPLINE REPRESENTATIONS a spline is a flexible strip used to produce a smooth curve through a designated set of points. We.
Chapter VI Parametric Curves and Surfaces
INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve.
June D Object Representation Shmuel Wimer Bar Ilan Univ., School of Engineering.
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Parametric Curves.
Geometric Modelling 2 INFO410 & INFO350 S Jack Pinches
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,
CS 376 Introduction to Computer Graphics 04 / 25 / 2007 Instructor: Michael Eckmann.
Basic Theory (for curve 02). 1.3 Parametric Curves  The main aim of computer graphics is to display an arbitrary surface so that it looks real.  The.
CS 445 / 645 Introduction to Computer Graphics Lecture 23 Bézier Curves Lecture 23 Bézier Curves.
Representation of Curves & Surfaces Prof. Lizhuang Ma Shanghai Jiao Tong University.
Parametric Curves CS 318 Interactive Computer Graphics John C. Hart.
Slide 129 October 1999CS Computer Graphics (Top Changwatchai) Bézier Curves - Results of Derivation Tangents at endpoints are equal to endpoint slopes.
Designing Parametric Cubic Curves 1. 2 Objectives Introduce types of curves ­Interpolating ­Hermite ­Bezier ­B-spline Analyze their performance.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Graphics CSCI 343, Fall 2015 Lecture 34 Curves and Surfaces III.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
CS 450: Computer Graphics PARAMETRIC SPLINES AND SURFACES
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.
CS 318 Intro to Computer Graphics John C. Hart
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.
Introduction to Parametric Curve and Surface Modeling.
COMPUTER GRAPHICS CHAPTERS CS 482 – Fall 2017 SPLINES
Computer Graphics Lecture 38
Curve-Fitting Spline Interpolation
© University of Wisconsin, CS559 Spring 2004
Chapter XVII Parametric Curves and Surfaces
Spline Interpolation Class XVII.
Curve design 455.
Three-Dimensional Object Representation
Introduction to Parametric Curve and Surface Modeling
Presentation transcript:

Review of Interpolation. A method of constructing a function that crosses through a discrete set of known data points.

Spline (general case) Given n+1 distinct knots x i such that: with n+1 knot values y i find a spline function with each S i (x) a polynomial of degree at most n.

Spline Interpolation Linear, Quadratic, Cubic Preferred over other polynomial interpolation More efficient High-degree polynomials are very computationally expensive Smaller error Interpolant is smoother

Natural Cubic Spline Interpolation S i (x) = a i x 3 + b i x 2 + c i x + d i 4 Coefficients with n subintervals = 4n equations There are 4 n-2 conditions Interpolation conditions Continuity conditions Natural Conditions S’’(x 0 ) = 0 S’’(x n ) = 0

Natural Conditions

Bezier Curves A similar but different problem: Controlling the shape of curves. Problem: given some (control) points, produce and modify the shape of a curve passing through the first and last point.

Bezier Curves Idea: Build functions that are combinations of some basic and simpler functions. Basic functions: B-splines Bernstein polynomials

Bernstein Polynomials Bernstein polynomials of degree n are defined by: For v = 0, 1, 2, …, n, In general there are N+1 Bernstein Polynomials of degree N. For example, the Bernstein Polynomials of degrees 1, 2, and 3 are: 1. B 0,1 (t) = 1-t, B 1,1 (t) = t; 2. B 0,2 (t) = (1-t) 2, B 1,2 (t) = 2t(1-t), B 2,2 (t) = t 2 ; 3. B 0,3 (t) = (1-t) 3, B 1,3 (t) = 3t(1-t) 2, B 2,3 (t)=3t 2 (1-t), B 3,3 (t) = t 3 ;

Deriving the Basis Polynomials Write 1 = t + (1-t) and raise 1 to the third power for cubic splines (2 for quadratic, 4 for quartic, etc…) 1^3 = (t + (1-t))^3 = t^3 + 3t^2(1-t) + 3t(1-t)^2 + (1-t)^3 The basis functions are the four terms: B 0 (t) = (1-t)^3 B 1 (t) = 3t(1-t)^2 B 2 (t) = 3t^2(1-t) B 3 (t) = t^3

Bernstein Polynomials Bernstein polynomials of degree 3

Using the Basis Functions To use the Bernstein basis functions to make a spline we need 4 “control” points for a cubic. (3 for quadratic, 5 for quartic, etc…) Let (x 0,y 0 ), (x 1,y 1 ), (x 2,y 2 ), (x 3,y 3 ) be the “control”points The x and y coordinates of the cubic Bezier spline are given by: x(t) = x 0 B 0 (t) + x 1 B 1 (t) +x 2 B 2 (t) + x 3 B 3 (t) y(t) = y 0 B 0 (t) + y 1 B 1 (t) + y 2 B 2 (t) + y 3 B 3 (t) Where 0<= t <= 1.

Bernstein Polynomials Given a set of control points {P i } N i=0, where P i = (x i, y i ). A Bezier curve of degree N is: P(t) = N i=0 P i B i,N (t), Where Bi,N(t), for I = 0, 1, …, N, are the Bernstein polynomials of degree N. P(t) is the Bezier curve Since P i = (x i, y i ) x(t) = N i=0 x i B i,N (t) and y(t) = N i=0 y i B i,N (t) The spline goes through (x 0,y 0 ) and (x 3,y 3 ) The tangent at those points is the line connecting (x 0,y 0 ) to (x 1,y 1 ) and (x 3,y 3 ) to (x 2,y 2 ). The positions of (x 1,y 1 ) and (x 2,y 2 ) determine the shape of the curve.

Bernstein Polynomials Example Find the Bezier curve which has the control points (2,2), (1,1.5), (3.5,0), (4,1). Substituting the x- and y-coordinates of the control points and N=3 into the x(t) and y(t) formulas on the previous slide yields x(t) = 2B 0,3 (t) + 1B 1,3 (t) + 3.5B 2,3 (t) + 4B 3,3 (t) y(t) = 2B 0,3 (t) + 1.5B 1,3 (t) + 0B 2,3 (t) + 1B 3,3 (t)

Bernstein Polynomials Example Substitute the Bernstein polynomials of degree three into these formulas to get x(t) = 2(1 – t) 3 + 3t(1 – t) t 2 (1 – t) + 4t 3 y(t) = 2(1-t) t(1 – t) 2 + t 3 Simplify these formulas to yield the parametric equation: P(t) = (2 – 3t t 2 – 5.5t 3, 2 – 1.5t – 3t t 3 ) where 0 < t < 1 P(t) is the Bezier curve r.html

Composite Bezier Curves In practice, shapes are often constructed of multiple Bezier curves combined together. Allows for flexibility in constructing shapes. (Consecutive Bezier curves need not join smoothly.)

Composite Bezier Curves Linking curves: Example: Find the composite Bezier curve for the four sets of control points: {(-9,0), (-8,1), (-8,2.5), (-4,2.5)}, {(-4,2.5), (-3,3.5), (-1,4), (0,4)} {(0,4), (2,4), (3,4), (5,2)}, {(5,2), (6,2), (20,3), (18,0)}

Composite Bezier Curves Use the same process as earlier to yield these four parametric equations: P 1 (t) = (-9 + 3t - 3t 2 + 5t 3, 3t + 1.5t 2 - 2t 3 ) P 2 (t) = (-4 + 3t + 3t 2 - 2t 3, t - 1.5t 2 ) P 3 (t) = (6t - 3t 2 + 2t 3, 4 - 2t 3 ) P 4 (t) = (5 + 3t + 39t t 3, 2 + 3t 2 - 5t 3 )

Composite Bezier Curves Linking Curves Smoothly To have two Bezier curves P(t) and Q(t) meet smoothly would require: P N = Q 0 P’(P N ) = Q’(Q 0 ) It is sufficient to require that the control points P N-1, P N = Q 0, and Q 1 be collinear.

Composite Bezier Curves Example of collinear control points: {(0,3), (1,5), (2,1), (3,3)} and {(3,3), (4,5), (5,1), (6,3)} P(t) = (3t, 3 + 6t - 18t t 3 ) Q(t) = (3 + 3t, 3 + 6t – 18t t 3 ) and P’(t) = (3, 6 – 36t + 36t 2 ) Q’(t) = (3, 6 – 36t + 36t 2 ) Substituting t = 1 and t = 0 into P’(t) and Q’(t), yields P’(1) = (3,6) = Q’(0)

Composite Bezier Curves It’s collinear!

Practical Applications

Practical Applications

Bézier surfaces in computer graphics