Modeling curves. Graphs: y = ax+b, y = sin(x) Implicit ax + by + c = 0, x 2 +y 2 =r 2 Parametric:

Similar documents
Bézier curves. Michael S. Floater. September 10, These notes provide an introduction to Bézier curves. i=0

Bezier curves. Michael S. Floater. August 25, These notes provide an introduction to Bezier curves. i=0

Nice plotting of proteins II

The univariate Bernstein-Bézier form

MA 323 Geometric Modelling Course Notes: Day 13 Bezier Curves & Bernstein Polynomials

Cubic Trigonometric Rational Wat Bezier Curves

DEGREE REDUCTION OF BÉZIER CURVES USING CONSTRAINED CHEBYSHEV POLYNOMIALS OF THE SECOND KIND

The Quadratic Trigonometric Bézier Curve with Single Shape Parameter

Spectral Graph Theory and its Applications September 16, Lecture 5

Affine transformations and convexity

Review of Taylor Series. Read Section 1.2

A Piecewise Rational Quintic Hermite Interpolant for Use in CAGD

Linear Feature Engineering 11

NUMERICAL DIFFERENTIATION

Report on Image warping

Math1110 (Spring 2009) Prelim 3 - Solutions

One Dimension Again. Chapter Fourteen

Support Vector Machines CS434

ACTM State Calculus Competition Saturday April 30, 2011

Chapter Twelve. Integration. We now turn our attention to the idea of an integral in dimensions higher than one. Consider a real-valued function f : D

The Second Eigenvalue of Planar Graphs

Formal solvers of the RT equation

AERODYNAMICS I LECTURE 6 AERODYNAMICS OF A WING FUNDAMENTALS OF THE LIFTING-LINE THEORY

Additional Codes using Finite Difference Method. 1 HJB Equation for Consumption-Saving Problem Without Uncertainty

CHAPTER 5 NUMERICAL EVALUATION OF DYNAMIC RESPONSE

Lecture 10 Support Vector Machines. Oct

APPENDIX A Some Linear Algebra

Complex Variables. Chapter 18 Integration in the Complex Plane. March 12, 2013 Lecturer: Shih-Yuan Chen

Gravitational Acceleration: A case of constant acceleration (approx. 2 hr.) (6/7/11)

Week3, Chapter 4. Position and Displacement. Motion in Two Dimensions. Instantaneous Velocity. Average Velocity

COMPLEX NUMBERS AND QUADRATIC EQUATIONS

( ) [ ( k) ( k) ( x) ( ) ( ) ( ) [ ] ξ [ ] [ ] [ ] ( )( ) i ( ) ( )( ) 2! ( ) = ( ) 3 Interpolation. Polynomial Approximation.

Polynomial Regression Models

Week 9 Chapter 10 Section 1-5

Least squares cubic splines without B-splines S.K. Lucas

Line Drawing and Clipping Week 1, Lecture 2

On the Multicriteria Integer Network Flow Problem

Section 8.3 Polar Form of Complex Numbers

Linear Approximation with Regularization and Moving Least Squares

Lectures - Week 4 Matrix norms, Conditioning, Vector Spaces, Linear Independence, Spanning sets and Basis, Null space and Range of a Matrix

PHYS 705: Classical Mechanics. Calculus of Variations II

Kernel Methods and SVMs Extension

20. Mon, Oct. 13 What we have done so far corresponds roughly to Chapters 2 & 3 of Lee. Now we turn to Chapter 4. The first idea is connectedness.

Complex Numbers Alpha, Round 1 Test #123

42. Mon, Dec. 8 Last time, we were discussing CW complexes, and we considered two di erent CW structures on S n. We continue with more examples.

Inductance Calculation for Conductors of Arbitrary Shape

CHALMERS, GÖTEBORGS UNIVERSITET. SOLUTIONS to RE-EXAM for ARTIFICIAL NEURAL NETWORKS. COURSE CODES: FFR 135, FIM 720 GU, PhD

Lecture 12: Discrete Laplacian

Lecture Notes on Linear Regression

Transfer Functions. Convenient representation of a linear, dynamic model. A transfer function (TF) relates one input and one output: ( ) system

= = = (a) Use the MATLAB command rref to solve the system. (b) Let A be the coefficient matrix and B be the right-hand side of the system.

9 Characteristic classes

THE EFFECTS OF USING DIFFERENT ALGORITHMS FOR CALCULATING THE FOOT OF SLOPE BASED ON THE MAXIMUM CHANGE OF GRADIENT

Snce h( q^; q) = hq ~ and h( p^ ; p) = hp, one can wrte ~ h hq hp = hq ~hp ~ (7) the uncertanty relaton for an arbtrary state. The states that mnmze t

Support Vector Machines CS434

Feature Selection: Part 1

Solutions to exam in SF1811 Optimization, Jan 14, 2015

Physics for Scientists & Engineers 2

Computer Graphics. Curves and Surfaces. Hermite/Bezier Curves, (B-)Splines, and NURBS. By Ulf Assarsson

The Finite Element Method: A Short Introduction

Statistical Inference. 2.3 Summary Statistics Measures of Center and Spread. parameters ( population characteristics )

A Robust Method for Calculating the Correlation Coefficient

More metrics on cartesian products

MMA and GCMMA two methods for nonlinear optimization

8.1 Arc Length. What is the length of a curve? How can we approximate it? We could do it following the pattern we ve used before

Lecture 10 Support Vector Machines II

Lecture 3. Ax x i a i. i i

Error Bars in both X and Y

Math 396. Metric tensor on hypersurfaces

σ τ τ τ σ τ τ τ σ Review Chapter Four States of Stress Part Three Review Review

is the calculated value of the dependent variable at point i. The best parameters have values that minimize the squares of the errors

ELASTIC WAVE PROPAGATION IN A CONTINUOUS MEDIUM

Tom Duff Computer Division Lucasfilm Ltd. Technical Memo No Dec 1983

THE WEIGHTED WEAK TYPE INEQUALITY FOR THE STRONG MAXIMAL FUNCTION

STAT 309: MATHEMATICAL COMPUTATIONS I FALL 2018 LECTURE 16

Lecture 21: Numerical methods for pricing American type derivatives

Summary with Examples for Root finding Methods -Bisection -Newton Raphson -Secant

Norms, Condition Numbers, Eigenvalues and Eigenvectors

Inner Product. Euclidean Space. Orthonormal Basis. Orthogonal

Lecture 4. Instructor: Haipeng Luo

PES 1120 Spring 2014, Spendier Lecture 6/Page 1

1 Matrix representations of canonical matrices

Multilayer Perceptrons and Backpropagation. Perceptrons. Recap: Perceptrons. Informatics 1 CG: Lecture 6. Mirella Lapata

Convexity preserving interpolation by splines of arbitrary degree

/ n ) are compared. The logic is: if the two

Notes on Frequency Estimation in Data Streams

3.1 Expectation of Functions of Several Random Variables. )' be a k-dimensional discrete or continuous random vector, with joint PMF p (, E X E X1 E X

Module 3: Element Properties Lecture 1: Natural Coordinates

ME 501A Seminar in Engineering Analysis Page 1

Section 8.1 Exercises

College of Computer & Information Science Fall 2009 Northeastern University 20 October 2009

Errors for Linear Systems

Monotonic Interpolating Curves by Using Rational. Cubic Ball Interpolation

Section 3.6 Complex Zeros

CHAPTER 9 Approximation theory and stability

Support Vector Machines

Visualization of Data Subject to Positive Constraints

Approximations of Set-Valued Functions Based on the Metric Average

Construction of Serendipity Shape Functions by Geometrical Probability

VQ widely used in coding speech, image, and video

Transcription:

Modelng curves Types of Curves Graphs: y = ax+b, y = sn(x) Implct ax + by + c = 0, x 2 +y 2 =r 2 Parametrc: x = ax + bxt x = cos t y = ay + byt y = snt Parametrc are the most common mplct are also used, Graphs: not flexble enough (e.g. cannot make a crcle). 1

Parametrc curves Parametrc curve can be thought of as a deformaton of a straght lne. If t s the dstance from some fxed pont of the lne, for each value of t we specfy the correspondng pont n the plane (or space): x = x(t); y = y(t); z = z(t) How do we choose functons x(t) and y(t)? Parametrc curves Typcal requrements: should be easy to use for modelng, that s, makng any desred shape should be smooth (ntuton: f we zoom n should look lke a straght lne), or pecewse smooth should be easy to draw 2

Tangents p(t) p (t+dt) Dervatves of the coordnates defne the tangent: tangent = dp(t) dx(t) dy(t) =, dt dt dt Note: the length of the tangent does not have a geometrc meanng, t depends on parameterzaton. Curvature Intuton: nverse of the radus of the best local approxmaton of the curve by a crcle. x y x y Formula: the dervatves are wth 2 2 3 2 (x + y ) respect to t. R Curvature at t s 1/R p(t) 3

Curvature Curvature measures how straght a curve s at a pont. If curvature s zero everywhere, the curve s a straght lne. y If x = t, curvature s 2 3 2 ( 1 + y ) ; for small y, ths s approxmately the second dervatve. The square of the curvature can be (sometmes) approxmated by x 2 + y 2. The less s the curvature, the ncer s the curve. Modelng We should be able to specfy a small number of ntutve controls; the curve should be automatcally computed from controls. Examples of ntutve controls: Connect the dots approach: specfy several ponts on the curve, draw a nce lne through these ponts; Specfy the drecton (tangent) of the curve n some places Unntutve controls: polynomal coeffcents etc. 4

Real-lfe splnes How was t done before computers? weghts (called ducks) were placed on a sheet of paper at ponts through whch the curve s supposed to pass A flexble steel strp s placed between them A curve s traced out on paper. Idea: try to do somethng smlar; whle modelng physcs s possble, t s somewhat expensve. Try to mtate behavor qualtatvely. Control ponts One possble way of defnng parametrc curves: Defne ponts near whch the curve should pass: p 1 = (x 1,y 1 ), p 2 = (x 2,y 2 )... For each pont p choose a parameter value t. Smplest choce: 1,2,3,... (unform parameterzaton). For each pont specfy a blendng functon B (t), whch defnes how much t contrbutes to the value of the curve at t. x(t) = xb (t) Defne the curve as or p(t) = pb (t) y(t) = y B (t) 5

Blendng functons Requrements for blendng (bass) functons B (t): The control pont p has maxmal nfluence near parameter value ; the further we are from, the less B should be; f we want local control (curve does not change far enough from a control pont) B (t) should be zero for t far from. Should look lke ths: If all control ponts are the same, the resultng curve should be reduced to the same pont. pb = = (t) p B (t) p, so B (t) = 1 Blendng functons Requrements Should be easy to compute (polynomals are); Should be contnuous, and dfferentable (C 1 ), preferably twce (C 2 ). Support (the nterval where t s not zero) should not be too bg. Would be nce to nterpolate the control ponts. Cannot get t all! But can get close f relax one of the requrements. 6

Splnes If gve up on small support, get natural splnes; every control pont nfluences the whole curve. If gve up on nterpolaton, get cubc B-splnes. Cubc B-splne bass functon B-Splnes Need only one bass functon, all B (t) are obtaned by shfts: B (t) = B(t-). The bass functon s pecewse polynomal: B() t = 0 t -2 1 + + + 6 t3 4 2 t t 2 3 t -1 2 t 2 1 3 2 t3 t 0 2 t 2 1 + 3 2 t3 t 1 4 2 t + t 2 1 3 6 t3 t 2 0 2 < t 7

B-splnes The curve wth control ponts p 0, p 2, p 3...p n s computed usng p(t) = n = 0 p B(t ) The allowed range of t s from 1 to n-1; outsde ths nterval our functons do not sum up to 1, whch means n partcular that f we move control ponts together n the same way, the curve outsde the nterval wll not move rgdly. B-splnes The mnmal number of ponts requred s 4; ths corresponds to the nterval for t of length 1. Ths s nconvenent - but we can always add control ponts by reflecton. 8

B-splnes Addng control ponts by reflecton: p n-1 p 1 p n p 0 p n+1 p -1 reflected ponts p -1 = 2p 0 -p 1 ; p n+1 = 2p n -p n-1. Drawng B-splnes Hardware typcally can draw only lne segments. Need to approxmate B-splne wth pecewse lnear curve. Smplest approach: Choose small t. Compute ponts p(0), p( t), p(2 t)... Draw lne segments connectng the ponts. Not very effcent -- have to evaluate a cubc polynomal (or several) at each pont. Can do better usng a magc algorthm (subdvson). 9

B-splnes va subdvson It turns out that the smooth curve can be obtaned by subdvson of the orgnal polylne: Subdvson adds new control ponts between the orgnal control ponts and updates postons of orgnal control ponts. Subdvson Subdvson rules for updatng old ponts: 3/4 1/8 1/8 Subdvson rules for nsertng new ponts: 1/2 1/2 10

Subdvson rules Even rule (n the new sequence of ponts the ponts wth even numbers are the old ponts wth updated postons). j j j ( p + p + p ) j+ 1 p2 = 1 8 1 6 + 1 Odd rule (n the new sequence the ponts wth odd number s a newly nserted pont). j j ( 4p p ) j+ 1 p2+ 1 = 1 8 + 4 + 1 Subdvson Of course, n a fnte number of steps subdvson generates only polylnes. But they get arbtrarly close to a lmt C 2 and ths curve s exactly a cubc B-splne. Algorthm: Start wth an array of control ponts of length n+1. Compute from the orgnal ponts new array of control ponts of length 2n+1 usng subdvson rules for even and odd ponts. Then from the new array compute an array of length 4n+1 etc., (typcally 4-5 steps s enough). Then draw the lne segments connectng sequental control ponts. 11

Endponts What do we do when a pont s mssng? reflected pont In ths case, we apply reflecton (recall addng mssng control ponts). Ths results n the followng trval rule: that s, just keep the old value. j j j j j ( p + 6p + ( p p )) p j+ 1 p0 = 1 8 1 0 2 0 1 = 0 Other splnes There many types of splnes: Bezer, Hermte, Natural, Catmull-Rom,... B-splnes are the most useful, but Bezer and Hermte are used wdely. Bezer are often found n drawng programs (e.g. Powerpont!) although they are not very convenent. 12

Bezer splnes Construct a curve out of segments. For each segment defne 4 ponts: two endponts and two other ponts determnng the tangents at endponts: used for tangents If we ensure that blue ponts on two sdes of each read pont are on one lne, the whole curve s C 1, that s, has a tangent everywhere. Bezer splnes The dea behnd Bezer splnes s to use specal blendng functons for the four ponts, assumng that t s between 0 and 1: (1-t) 3 for p 0, 3t(1-t) 2 for p 1, 3t 2 (1-t) for p 2, and t 3 for p 3. (1-t) 3 t 3 3t(1-t) 2 3t 2 (1-t) 13

Bezer splnes The 4 functons (Bernsten polynomals of order 3), P 0 (t), P 1 (t), P 2 (t), P 3 (t) are (almost) defned by the followng propertes: The sum s 1 for all t the endponts have no nfluence on the poston of the endpont of the curve and on the tangents at opposte endponts. Ths means that P 0 (1) = P 0 (1) =0, P 3 (0) = P 3 (0) =0 Two nteror (blue) control ponts affect only the tangent and at the correspondng endpont, not at the other endpont, and do not affect the postons of the endponts of the curve P 1 (0) =P 1 (1) = P 1 (1) =0, P 2 (1) =P 2 (0) = P 2 (0) =0 All polynomals are cubc and postve Symmetry w.r.t. t=1/2: P 0 (1-t) = P 3 (t), P 1 (1-t) = P 2 (t) Bezer curves The Bezer curves have the followng propertes: endponts are nterpolated tangents at endponts pont towards the nteror control ponts; dervatves are 3(p 1 -p 0 ) and 3(p 3 -p 2 ) respectvely; the curve s n the convex hull of control ponts. The formula for the Bezer curve s p(t) = (1-t) 3 p 0 + 3t(1-t) 2 p 1 + 3t 2 (1-t) p 2 + t 3 p 3 t between 0 and 1. 14