Mean Value Coordinates

Transcription

1 Mean Value Coordinates Michael S. Floater Abstract: We derive a generalization of barycentric coordinates which allows a vertex in a planar triangulation to be expressed as a convex combination of its neighbouring vertices. The coordinates are motivated by the Mean Value Theorem for harmonic functions and can be used to simplify and improve methods for parameterization and morphing. Keywords: barycentric coordinates, harmonic function, mean value theorem, parameterization, morphing. 1. Introduction Let v 0, v 1,..., v k be points in the plane with v 1,..., v k arranged in an anticlockwise ordering around v 0, as in Figure 1. The points v 1,..., v k form a star-shaped polygon with v 0 in its kernel. Our aim is to study sets of weights λ 1,..., λ k 0 such that λ i v i = v 0, (1.1) λ i = 1. (1.2) Equation (1.1) expresses v 0 as a convex combination of the neighbouring points v 1,..., v k. In the simplest case k = 3, the weights λ 1, λ 2, λ 3 are uniquely determined by (1.1) and (1.2) alone; they are the barycentric coordinates of v 0 with respect to the triangle [v 1, v 2, v 3 ], and they are positive. This motivates calling any set of non-negative weights satisfying ( ) for general k, a set of coordinates for v 0 with respect to v 1,..., v k. There has long been an interest in generalizing barycentric coordinates to k-sided polygons with a view to possible multisided extensions of Bézier surfaces; see for example [ 8 ]. In this setting, one would normally be free to choose v 1,..., v k to form a convex polygon but would need to allow v 0 to be any point inside the polygon or on the polygon, i.e. on an edge or equal to a vertex. More recently, the need for such coordinates arose in methods for parameterization [ 2 ] and morphing [ 5 ], [ 6 ] of triangulations. Here the points v 0, v 1,..., v k will be vertices of a (planar) triangulation and so the point v 0 will never lie on an edge of the polygon formed by v 1,..., v k. If we require no particular properties of the coordinates, the problem is easily solved. Because v 0 lies in the convex hull of v 1,..., v k, there must exist at least one triangle T = [v i1, v i2, v i3 ] which contains v 0, and so we can take λ i1, λ i2, λ i3 to be the three barycentric coordinates of v 0 with respect to T, and make the remaining coordinates zero. However, these coordinates depend randomly on the choice of triangle. An improvement is to take an average of such coordinates over certain covering triangles, as proposed in [ 2 ]. The resulting coordinates depend continuously on v 0, v 1,..., v k, yet still not smoothly. The 1

2 Figure 1. Star-shaped polygon. main purpose of this paper is to address this latter problem. We derive coordinates which depend (infinitely) smoothly on the data points v 0, v 1,..., v k through a simple algebraic formula. Several researchers have studied closely related problems [ 9,11,14,15 ]. In the special case that the polygon v 1,..., v k is convex, Wachspress [ 14 ] found a solution in which the coordinates can be expressed in terms of rational polynomials, λ i = w i k j=1 w, w i = j A(v i 1, v i, v i+1 ) A(v i 1, v i, v 0 )A(v i, v i+1, v 0 ) = cot γ i 1 + cot β i v i v 0 2, (1.3) where A(a, b, c) is the signed area of triangle [a, b, c] and γ i 1 and β i are the angles shown in Figure 1. The latter formulation in terms of angles is due to Meyer, Lee, Barr, and Desbrun [ 9 ]. Of course these coordinates depend smoothly on the data points v 0, v 1,..., v k and are therefore suitable when the polygon is convex. However, for star-shaped polygons the coordinate λ i in (1.3) can be negative, and, in fact, will be so precisely when γ i 1 +β i > π. Another set of previously found weights can be expressed as λ i = w i k j=1 w, w i = cot β i 1 + cot γ i. (1.4) j These weights arise from the standard piecewise linear finite element approximation to the Laplace equation and appear in several books on numerical analysis, e.g. [ 7 ], and probably go back to the work of Courant. They have since been used in the computer graphics literature [ 10 ], [ 1 ]. However, for our purposes these weights suffer from the same problem as the last ones, namely that they might be negative. The weight λ i is negative if and only if β i 1 + γ i > π. Another possible set of coordinates might be Sibson s natural neighbour coordinates [ 11 ], if we treated the points v 1,..., v k as a set of scattered data points. However, despite various other good properties, Sibson s coordinates, like those of [ 2 ], suffer from being defined piecewise, and have in general only C 1 dependence on the point v 0. Moreover, several of Sibson s coordinates might be zero, since the only non-zero ones would correspond to Voronoi neighbours of v 0. 2

3 2. Mean Value Coordinates We now describe a set of coordinates which satisfy all the properties we would like. Let α i, 0 < α i < π, be the angle at v 0 in the triangle [v 0, v i, v i+1 ], defined cyclically; see Figure 1. Proposition 1. The weights λ i = w i k j=1 w j are coordinates for v 0 with respect to v 1,..., v k., w i = tan(α i 1/2) + tan(α i /2), (2.1) v i v 0 As will be explained in Section 3, these weights can be derived from an application of the mean value theorem for harmonic functions, which suggests calling them mean value coordinates. They obviously depend smoothly on the points v 0, v 1,..., v k. Proof: Since 0 < α i < π, we see that tan(α i /2) is defined and positive, and therefore λ i is well-defined and positive for i = 1,..., k, and by definition the λ i sum to one. It remains to prove (1.1). From (2.1), equation (1.1) is equivalent to w i (v i v 0 ) = 0. (2.2) We next use polar coordinates, centred at v 0, so that Then we have and equation (2.2) becomes or equivalently v i = v 0 + r i (cos, sin ). v i v 0 v i v 0 = (cos, sin ), and α i = +1, (tan(α i 1 /2) + tan(α i /2))(cos, sin ) = 0, tan(α i /2)((cos, sin ) + (cos +1, sin +1 )) = 0. (2.3) To establish this latter identity, observe that 0 = = = 2π 0 (cos θ, sin θ) dθ (cos θ, sin θ) dθ sin(+1 θ) (cos, sin ) + sin(θ ) (cos +1, sin +1 ) dθ, sin α i sin α i 3 (2.4)

4 the last line following from the addition formula for sines. Since also and sin(+1 θ) dθ = equation (2.4) reduces to equation (2.3). sin(θ ) dθ = 1 cos α i, (2.5) tan(α i /2) = 1 cos α i sin α i, (2.6) Not only are these coordinates positive, but we can bound them away from zero. This might be useful when considering the conditioning of the linear systems used in [ 2,5,6 ]. If L = max i v i v 0, L = min i v i v 0 and α = max i α i, α = min i α i, then from (2.1) we have 2 tan(α /2) L w i 2 tan(α /2), L and where 1 Ck λ i C k, (2.7) C = L tan(α /2) L tan(α /2) 1. The inequality (2.7) becomes an equality when C = 1 which occurs when v 1,..., v k is a regular polygon and v 0 is its centre. 3. Motivation The motivation behind the coordinates was an attempt to approximate harmonic maps by piecewise linear maps over triangulations, in such a way that injectivity is preserved. Recall that a C 2 function u defined over a planar region Ω is harmonic if it satisfies the Laplace equation u xx + u yy = 0. Suppose we want to approximate the solution u with respect to Dirichlet boundary conditions, u Ω = u 0, by a piecewise linear function u T over some triangulation T of Ω. Thus u T will be an element of the spline space S1(T 0 ). The finite element approach to this problem is to take u T to be the unique element of S1(T 0 ) which minimizes Ω u T 2 dx subject to the boundary conditions. As is well known, this leads to a sparse linear system in the values of u T at the interior vertices of the triangulation T. To be precise, suppose 4

5 v 0 in Figure 1 is an interior vertex of the triangulation. As described in several books on numerical analysis, the equation associated with v 0 can be expressed as u T (v 0 ) = λ i u T (v i ), (3.1) where λ i is given by equation (1.4). Suppose now that we use this method component-wise to approximate a harmonic map φ : Ω lr 2, that is a map φ = (φ 1, φ 2 ) for which both φ 1 and φ 2 are harmonic functions, by a piecewise linear map φ T : Ω lr 2. We would like the map φ T to be injective and a sufficient condition has been derived in [ 13 ] and [ 4 ]: if φ T is a convex combination map, i.e. at every interior vertex v 0 of T, we have φ T (v 0 ) = λ i φ T (v i ), (3.2) for some positive weights λ 1,..., λ k which sum to one, and if φ T maps the boundary T homeomorphically to the boundary of a convex region, then φ T is one-to-one. From this point of view, the standard finite element approximation φ T has a drawback: the theory of [ 13 ] and [ 4 ] cannot be applied. The map φ T will not in general be a convex combination map because the weights λ i in (1.4) can be negative which can lead to foldover in the map (an example is given in [ 3 ]). This motivates, if possible, approximating a harmonic map φ by a convex combination map φ T, i.e., one with positive weights in (3.2). Consider the following alternative discretization of a harmonic function u. Recall that harmonic functions satisfy the mean value theorem. The mean value theorem comes in two forms. Circumferential Mean Value Theorem. For a disc B = B(v 0, r) Ω with boundary Γ, u(v 0 ) = 1 u(v) ds. 2πr Γ Solid Mean Value Theorem. u(v 0 ) = 1 πr 2 u(v) dx dy. This suggests finding the element u T of S1(T 0 ) which satisfies one of the two mean value theorems locally at every interior vertex v 0 of T. We will concentrate on the first version and demand that u T (v 0 ) = 1 u T (v) ds, (3.3) 2πr for r sufficiently small that the disc B(v 0, r) is entirely contained in the union of the triangles containing v 0 ; see Figure 2. It turns out that this equation can be expressed in the form of (3.1) where the weights λ i are those of (2.1), independent of the choice of r. To see this, consider the triangle T i = [v 0, v i, v i+1 ] in Figure 2 and let Γ i be the part of Γ contained in T i. 5 B Γ

7 Proposition 2. Suppose the piecewise linear function u T : Ω lr satisfies the local mean value theorem, i.e., for each interior vertex v 0, it satisfies equation (3.3) for some r > 0 suitably small. Then u T (v 0 ) is given by the convex combination in (3.1) with the weights λ i of (2.1). Proof: Equation (3.3) can be written as u T (v 0 ) = 1 2πr which, after applying Lemma 1 to u T, reduces to 0 = Γ i u T (v) ds, ( ut (v i ) u T (v 0 ) tan(α i /2) + u ) T (v i+1 ) u T (v 0 ), v i v 0 v i+1 v 0 which is equivalent to equation (3.1) with the weights of (2.1). We now notice that Proposition 1 follows from Proposition 2 due to the simple observation that linear bivariate functions are trivially harmonic. It is not difficult to show that Proposition 2 remains true when the solid mean value theorem is used instead of the circumferential one, the main point being that λ 1 and λ 2 in equation (3.7) are linear in r. We remark finally that it is well known that the standard finite element approximation u T converges to u in various norms as the mesh size of the triangulation T tends to zero, under certain conditions on the angles of the triangles. Initial numerical tests suggest that the mean value approximation does not converge to u in general. An interesting question for future research is whether it is in fact possible to approximate a harmonic map by a convex combination map over an arbitrary triangulation with sufficiently small mesh size. 4. Applications In the parameterization method of [ 2 ], the triangulation is a spatial one, so that the vertices v 0,..., v k are points in lr 3. However, the mean value coordinates can be applied directly to the triangulation; we simply compute the coordinates λ i of equation (2.1) directly from the vertices v 0,..., v k lr 3. The numerical example of Figure 3 shows the result of parameterizing a triangle mesh (3a) and mapping a rectangular grid in the parameter plane back onto the mesh. The three parameterizations used are uniform (3b) (i.e. Tutte s embedding), shape-preserving (3c), and mean value (3d). In this example the mean value parameterization looks at least as good as the shape-preserving one of [ 2 ]. In addition, the mean value coordinates are faster to compute than the shape-preserving coordinates, and have the theoretical advantage that the resulting parameterization will depend smoothly on the vertices of the triangulation. Mean value coordinates can also be used to morph pairs of compatible planar triangulations, adapting the method of [ 5 ]. Such a morph will depend smoothly on the vertices of the two triangulations. Surazhsky and Gotsman found recently that mean value morphs are visually smoother than previous morphs; see [ 12 ] for details. 7

8 Figure 3. Comparisons from left to right: (3a) Triangulation, (3b) Tutte, (3c) shape-preserving, (3d) mean value 5. Final remarks When k = 3 the mean value coordinates, like Wachspress s coordinates, are equal to the three barycentric coordinates, due to uniqueness. When k = 4 the mean value coordinates and Wachspress coordinates are different in general. For example, when the points v 1, v 2, v 3, v 4 form a rectangle, the Wachspress coordinates are bilinear, while the mean value coordinates are not. If the points v 1,..., v k form a convex polygon, the mean value coordinates are defined for all points v 0 inside the polygon, but due to the use of the angles α i in formula (2.1), it is not obvious whether the coordinates can be extended to the polygon itself. Though this paper was not intended to deal with this issue, it would be important if these coordinates were to be used for generalizing Bezier surfaces, as in [ 8 ]. For Wachspress s coordinates (1.3), this is not a problem because by multiplying by the product of all areas A(v j, v j+1, v 0 ), they have the well-known equivalent expression λ i = w i k j=1 w j, w i = A(v i 1, v i, v i+1 ) j i 1,i A(v j, v j+1, v 0 ). It turns out that the mean value coordinates can also be continuously extended to the polygon itself. Moreover, like Wachspress s coordinates, they are linear along each edge of the polygon and have the Lagrange property at the vertices: if v 0 = v i then λ i = 1 and λ j = 0 for j i. A proof of this as well as other properties of these coordinates will appear in a forthcoming paper. Acknowledgement. I wish to thank Mathieu Desbrun for supplying the data set for the numerical example and the referees for their comments. This work was partly supported by the European Union project MINGLE, contract num. HPRN-CT

Mathematics Course 111: Algebra I Part IV: Vector Spaces D. R. Wilkins Academic Year 1996-7 9 Vector Spaces A vector space over some field K is an algebraic structure consisting of a set V on which are

CHAPTER 4 CURVES 4.1 Introduction In order to understand the significance of curves, we should look into the types of model representations that are used in geometric modeling. Curves play a very significant

Numerical Analysis Lecture Notes Peter J. Olver 5. Inner Products and Norms The norm of a vector is a measure of its size. Besides the familiar Euclidean norm based on the dot product, there are a number

The Calculus of Functions of Several Variables Section. Introduction to R n Calculus is the study of functional relationships and how related quantities change with each other. In your first exposure to

SPERNER S LEMMA AND BROUWER S FIXED POINT THEOREM ALEX WRIGHT 1. Intoduction A fixed point of a function f from a set X into itself is a point x 0 satisfying f(x 0 ) = x 0. Theorems which establish the

olutions for Review Problems 1. Let be the triangle with vertices A (,, ), B (4,, 1) and C (,, 1). (a) Find the cosine of the angle BAC at vertex A. (b) Find the area of the triangle ABC. (c) Find a vector

1 Chapter 13. VECTORS IN THREE DIMENSIONAL SPACE Let s begin with some names and notation for things: R is the set (collection) of real numbers. We write x R to mean that x is a real number. A real number

CONTINUED FRACTIONS AND PELL S EQUATION SEUNG HYUN YANG Abstract. In this REU paper, I will use some important characteristics of continued fractions to give the complete set of solutions to Pell s equation.

Chapter 4 Ideal Class Group and Units We are now interested in understanding two aspects of ring of integers of number fields: how principal they are (that is, what is the proportion of principal ideals

Induction Problems Tom Davis tomrdavis@earthlin.net http://www.geometer.org/mathcircles November 7, 2005 All of the following problems should be proved by mathematical induction. The problems are not necessarily

Big Ideas in Mathematics which are important to all mathematics learning. (Adapted from the NCTM Curriculum Focal Points, 2006) The Mathematics Big Ideas are organized using the PA Mathematics Standards

John Vince Essential Mathematics for Computer Graphics fast Springer Contents 1. MATHEMATICS 1 Is mathematics difficult? 3 Who should read this book? 4 Aims and objectives of this book 4 Assumptions made

Academic Content Standards Grade Eight Ohio Pre-Algebra 2008 STANDARDS Number, Number Sense and Operations Standard Number and Number Systems 1. Use scientific notation to express large numbers and small

Course Description Math 1B Syllabus This Pre-Calculus course is designed to prepare students for a Calculus course. This course is taught so that students will acquire a solid foundation in algebra and

1: 1. Compute a random 4-dimensional polytope P as the convex hull of 10 random points using rand sphere(4,10). Run VISUAL to see a Schlegel diagram. How many 3-dimensional polytopes do you see? How many

Understanding Basic Calculus S.K. Chung Dedicated to all the people who have helped me in my life. i Preface This book is a revised and expanded version of the lecture notes for Basic Calculus and other

. INNER PRODUCT SPACES.. Definition So far we have studied abstract vector spaces. These are a generalisation of the geometric spaces R and R. But these have more structure than just that of a vector space.

æ If 3 + 4 = x, then x = 2 gold bar is a rectangular solid measuring 2 3 4 It is melted down, and three equal cubes are constructed from this gold What is the length of a side of each cube? 3 What is the

MATHS LEVEL DESCRIPTORS Number Level 3 Understand the place value of numbers up to thousands. Order numbers up to 9999. Round numbers to the nearest 10 or 100. Understand the number line below zero, and

Equations Involving Lines and Planes In this section we will collect various important formulas regarding equations of lines and planes in three dimensional space Reminder regarding notation: any quantity

MATH 45, PRACTICE FINAL EXAM SOLUTIONS. Exercise. a Is the operator L defined on smooth functions of x, y by L u := u xx + cosu linear? b Does the answer change if we replace the operator L by the operator

Seminar Path planning using Voronoi diagrams and B-Splines Stefano Martina stefano.martina@stud.unifi.it 23 may 2016 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International

NEW YORK STATE TEACHER CERTIFICATION EXAMINATIONS TEST DESIGN AND FRAMEWORK September 2014 Authorized for Distribution by the New York State Education Department This test design and framework document

LINEAR ALGEBRA W W L CHEN c W W L Chen, 1997, 2008 This chapter is available free to all individuals, on understanding that it is not to be used for financial gain, and may be downloaded and/or photocopied,

MATHEMATICS: THE LEVEL DESCRIPTIONS In mathematics, there are four attainment targets: using and applying mathematics; number and algebra; shape, space and measures, and handling data. Attainment target

Accelerated Mathematics 3 This is a course in precalculus and statistics, designed to prepare students to take AB or BC Advanced Placement Calculus. It includes rational, circular trigonometric, and inverse

Review Sheet for Test 1 Math 261-00 2 6 2004 These problems are provided to help you study. The presence of a problem on this handout does not imply that there will be a similar problem on the test. And

Prime Numbers and Irreducible Polynomials M. Ram Murty The similarity between prime numbers and irreducible polynomials has been a dominant theme in the development of number theory and algebraic geometry.

Math 44, Section 6. Review These notes will supplement not replace) the lectures based on Section 6. Section 6. i) ouble integrals over general regions: We defined double integrals over rectangles in the

Curriculum Map by Geometry Mapping for Math Testing 2007-2008 Pre- s 1 August 20 to August 24 Review concepts from previous grades. August 27 to September 28 (Assessment to be completed by September 28)

We Can Early Learning Curriculum PreK Grades 8 12 INSIDE ALGEBRA, GRADES 8 12 CORRELATED TO THE SOUTH CAROLINA COLLEGE AND CAREER-READY FOUNDATIONS IN ALGEBRA April 2016 www.voyagersopris.com Mathematical

5. GEOMETRIC MODELING Types of Curves and Their Mathematical Representation Types of Surfaces and Their Mathematical Representation Types of Solids and Their Mathematical Representation CAD/CAM Data Exchange

Math 1d Instructor: Padraic Bartlett Lectures 5-: Taylor Series Weeks 5- Caltech 213 1 Taylor Polynomials and Series As we saw in week 4, power series are remarkably nice objects to work with. In particular,

710 Chapter Thirteen A FUNDAMENTAL TOOL: VECTORS 62. Use the following steps and the results of Problems 59 60 to show (without trigonometry) that the geometric and algebraic definitions of the dot product

MAT 051 Pre-Algebra Mathematics (MAT) MAT 051 is designed as a review of the basic operations of arithmetic and an introduction to algebra. The student must earn a grade of C or in order to enroll in MAT

ON TORI TRIANGULATIONS ASSOCIATED WITH TWO-DIMENSIONAL CONTINUED FRACTIONS OF CUBIC IRRATIONALITIES. O. N. KARPENKOV Introduction. A series of properties for ordinary continued fractions possesses multidimensional

MA 323 Geometric Modelling Course Notes: Day 02 Model Construction Problem David L. Finn November 30th, 2004 In the next few days, we will introduce some of the basic problems in geometric modelling, and

January 10, 2010 CHAPTER SIX IRREDUCIBILITY AND FACTORIZATION 1. BASIC DIVISIBILITY THEORY The set of polynomials over a field F is a ring, whose structure shares with the ring of integers many characteristics.

This space is reserved for the Procedia header, do not use it How High a Degree is High Enough for High Order Finite Elements? William F. National Institute of Standards and Technology, Gaithersburg, Maryland,

TRIGONOMETRY Chapter Trigonometry Objectives After studying this chapter you should be able to handle with confidence a wide range of trigonometric identities; be able to express linear combinations of

Vectors, Gradient, Divergence and Curl. 1 Introduction A vector is determined by its length and direction. They are usually denoted with letters with arrows on the top a or in bold letter a. We will use

Open Research Online The Open University s repository of research publications and other research outputs The degree-diameter problem for circulant graphs of degree 8 and 9 Journal Article How to cite:

Lecture 14: Section 3.3 Shuanglin Shao October 23, 2013 Definition. Two nonzero vectors u and v in R n are said to be orthogonal (or perpendicular) if u v = 0. We will also agree that the zero vector in

Chapter 7 Classification of Cartan matrices In this chapter we describe a classification of generalised Cartan matrices This classification can be compared as the rough classification of varieties in terms

Exam Sample Question SOLUTIONS. Eliminate the parameter to find a Cartesian equation for the curve: x e t, y e t. SOLUTION: You might look at the coordinates and notice that If you don t see it, we can

Core Standards of the Course Standard 1 Students will acquire number sense and perform operations with real and complex numbers. Objective 1.1 Compute fluently and make reasonable estimates. 1. Simplify