Generalized barycentric coordinates

Similar documents
Parameterization. Michael S. Floater. November 10, 2011

Parameterization of triangular meshes

Differential Geometry: Circle Patterns (Part 1) [Discrete Conformal Mappinngs via Circle Patterns. Kharevych, Springborn and Schröder]

Review of Trigonometry

AQA GCSE Further Maths Topic Areas

Surface Parameterization

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates

Summer Review for Students Entering Pre-Calculus with Trigonometry. TI-84 Plus Graphing Calculator is required for this course.

Comparison and affine combination of generalized barycentric coordinates for convex polygons

Graphics and Interaction Transformation geometry and homogeneous coordinates

Generalized Barycentric Coordinates

Summer Review for Students Entering Pre-Calculus with Trigonometry. TI-84 Plus Graphing Calculator is required for this course.

Unit 2: Trigonometry. This lesson is not covered in your workbook. It is a review of trigonometry topics from previous courses.

Math 26: Fall (part 1) The Unit Circle: Cosine and Sine (Evaluating Cosine and Sine, and The Pythagorean Identity)

CCSSM Curriculum Analysis Project Tool 1 Interpreting Functions in Grades 9-12

Lectures in Discrete Differential Geometry 3 Discrete Surfaces

EXTREME POINTS AND AFFINE EQUIVALENCE

7. The Gauss-Bonnet theorem

SOME PROPERTIES OF TRIGONOMETRIC FUNCTIONS. 5! x7 7! + = 6! + = 4! x6

Def De orma f tion orma Disney/Pixar

Generalized Barycentric Coordinates

. Tutorial Class V 3-10/10/2012 First Order Partial Derivatives;...

Ganado Unified School District Pre-Calculus 11 th /12 th Grade

A new 8-node quadrilateral spline finite element

Ganado Unified School District Trigonometry/Pre-Calculus 12 th Grade

GEOMETRIC TOOLS FOR COMPUTER GRAPHICS

Lagrange multipliers October 2013

Dual Interpolants for Finite Element Methods

Math for Geometric Optics

APPROXIMATING THE MAXMIN AND MINMAX AREA TRIANGULATIONS USING ANGULAR CONSTRAINTS. J. Mark Keil, Tzvetalin S. Vassilev

Pi at School. Arindama Singh Department of Mathematics Indian Institute of Technology Madras Chennai , India

Integrated Algebra 2 and Trigonometry. Quarter 1

Kai Hormann, N. Sukumar. Generalized Barycentric Coordinates in Computer Graphics and Computational Mechanics

To graph the point (r, θ), simply go out r units along the initial ray, then rotate through the angle θ. The point (1, 5π 6. ) is graphed below:

Trigonometry Curriculum Guide Scranton School District Scranton, PA

Unit 7: Trigonometry Part 1

ECE 600, Dr. Farag, Summer 09

Lagrange multipliers 14.8

Accel. Geometry - Concepts Similar Figures, Right Triangles, Trigonometry

Cecil Jones Academy Mathematics Fundamentals

CS337 INTRODUCTION TO COMPUTER GRAPHICS. Describing Shapes. Constructing Objects in Computer Graphics. Bin Sheng Representing Shape 9/20/16 1/15

Digital Geometry Processing Parameterization I

Gardener s spline curve

SM 2. Date: Section: Objective: The Pythagorean Theorem: In a triangle, or

Section 10.1 Polar Coordinates

To graph the point (r, θ), simply go out r units along the initial ray, then rotate through the angle θ. The point (1, 5π 6

Math 126 Number Theory

SUM AND DIFFERENCES. Section 5.3 Precalculus PreAP/Dual, Revised 2017

CS123 INTRODUCTION TO COMPUTER GRAPHICS. Describing Shapes. Constructing Objects in Computer Graphics 1/15

Year Term Week Chapter Ref Lesson 18.1 Cubic and reciprocal functions. 18 Graphs 2. (Algebra) 18.4 Gradients and areas under graphs

Sec 4.1 Trigonometric Identities Basic Identities. Name: Reciprocal Identities:

Ganado Unified School District #20 (Pre-Calculus 11th/12th Grade)

Deformation II. Disney/Pixar

Grad operator, triple and line integrals. Notice: this material must not be used as a substitute for attending the lectures

CLEP Pre-Calculus. Section 1: Time 30 Minutes 50 Questions. 1. According to the tables for f(x) and g(x) below, what is the value of [f + g]( 1)?

To be a grade 1 I need to

with slopes m 1 and m 2 ), if and only if its coordinates satisfy the equation y y 0 = 0 and Ax + By + C 2

1 Euler characteristics

Bramhall high school Year 9 Assessment descriptor Mathematics

PS Geometric Modeling Homework Assignment Sheet I (Due 20-Oct-2017)

Lectures 19: The Gauss-Bonnet Theorem I. Table of contents

Preferred directions for resolving the non-uniqueness of Delaunay triangulations

Geometric transformations assign a point to a point, so it is a point valued function of points. Geometric transformation may destroy the equation

What is log a a equal to?

Mathematics for Computer Graphics. Trigonometry

CURVES OF CONSTANT WIDTH AND THEIR SHADOWS. Have you ever wondered why a manhole cover is in the shape of a circle? This

Curves and Surfaces. Shireen Elhabian and Aly A. Farag University of Louisville

CS 4620 Final Exam. (a) Is a circle C 0 continuous?

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

DD2429 Computational Photography :00-19:00

Conforming Vector Interpolation Functions for Polyhedral Meshes

1. The Pythagorean Theorem

Mathematical Programming and Research Methods (Part II)

Lecture 2 - Introduction to Polytopes

The goal is the definition of points with numbers and primitives with equations or functions. The definition of points with numbers requires a

CSCI 4620/8626. Coordinate Reference Frames

Linear algebra deals with matrixes: two-dimensional arrays of values. Here s a matrix: [ x + 5y + 7z 9x + 3y + 11z

SL1.Trig.1718.notebook. April 15, /26 End Q3 Pep talk. Fractal Friday: April 6. I want to I will I can I do

Basics of Computational Geometry

SNAP Centre Workshop. Introduction to Trigonometry

Background for Surface Integration

In a right triangle, the sum of the squares of the equals the square of the

CS 177 Homework 1. Julian Panetta. October 22, We want to show for any polygonal disk consisting of vertex set V, edge set E, and face set F:

The Humble Tetrahedron

PLANE TRIGONOMETRY Exam I September 13, 2007

Level 4 means that I can

Algebra II. Slide 1 / 162. Slide 2 / 162. Slide 3 / 162. Trigonometric Functions. Trig Functions

Chapter 9. Linear algebra applications in geometry

Constrained Delaunay Triangulations (CDT)

Chapter 9: Right Triangle Trigonometry

Ch. 2 Trigonometry Notes

2009 GCSE Maths Tutor All Rights Reserved

Introduction to Complex Analysis

by Kevin M. Chevalier

Mastery. PRECALCULUS Student Learning Targets

Supplementary Information. Design of Hierarchical Structures for Synchronized Deformations

AQA GCSE Maths - Higher Self-Assessment Checklist

INTRODUCTION TO FINITE ELEMENT METHODS

STANDARDS FOR SECONDARY EDUCATION. mathematics

Jorg s Graphics Lecture Notes Coordinate Spaces 1

Transcription:

Generalized barycentric coordinates Michael S. Floater August 20, 2012 In this lecture, we review the definitions and properties of barycentric coordinates on triangles, and study generalizations to convex, and non-convex polygons. These generalized coordinates have various applications in computer graphics, including curve, surface, and image deformation, and parameterization of triangular meshes. 1 Triangular coordinates Let T be a triangle in R 2 with vertices v 1,v 2,v 3. For convenience we will assume that v 1,v 2,v 3 are in anti-clockwise order around the boundary of T, as in Figure 1. It has been known for a long time, and was at least known by Mobius, that any point x in T can be expressed uniquely as a convex combination of the three vertices. In other words, there are unique real values λ 1,λ 2,λ 3 0 such that and λ 1 + λ 2 + λ 3 = 1, (1) λ 1 v 1 + λ 2 v 2 + λ 3 v 3 = x. (2) To see this, observe that the scalar equation (1) and the vector equation (2) together form a linear system of three equations, 1 1 1 λ 1 1 v1 1 v2 1 v3 1 λ 2 = x 1, (3) v1 2 v2 2 v3 2 λ 3 x 2 1

v 3 T x v 1 v 2 Figure 1: Point in a triangle. where v j = (vj,v 1 j), 2 j = 1, 2, 3, and x = (x 1,x 2 ). Since the signed area of the triangle T is given by A(v 1,v 2,v 3 ) = 1 1 1 1 2 v1 1 v2 1 v3 1 v1 2 v2 2 v3 2, (4) the assumption that T is non-degenerate implies that the matrix in (3) is non-singular, and Cramer s rule gives the unique solution λ 1 = A(x,v 2,v 3 ) A(v 1,v 2,v 3 ), λ 2 = A(v 1,x,v 3 ) A(v 1,v 2,v 3 ), λ 3 = A(v 1,v 2,x) A(v 1,v 2,v 3 ). (5) The values λ i are called the barycentric coordinates of the point x. Observe that due to the anti-clockwise ordering of the vertices v 1,v 2,v 3, all four areas in (5) are non-negative and therefore λ 1,λ 2,λ 3 have the important property of being non-negative. Had the vertices been ordered clockwise, all the areas in (5) would have had the opposite sign but we would again have λ 1,λ 2,λ 3 0. The three areas in the numerators in (5) are shown in Figure 2 where A i denotes the triangle area A(x,v i+1,v i+2 ) with indices regarded cyclically: if j = k + 3m, with k {1, 2, 3} and m Z, then v j := v k. Viewed as functions of x, we see from (5) that the λ i are linear polynomials, and from now on we treat them as functions of x. Using either (2) or (5) we see that they have the Lagrange property, λ i (v j ) = δ ij. (6) 2

v 3 A 2 x A 1 A 3 v 1 v 2 Figure 2: Areas of triangles formed by x. 0 1 0 Figure 3: Values of λ 1 at the vertices. Here, δ ij denotes the Kronecker delta function that has value 1 when i = j and value 0 when i j. The values of λ 1 at the vertices are shown in Figure 3. The linear polynomials λ 1,λ 2,λ 3 are clearly well-defined for all x R 2. However, they are are not all positive outside T. Their signs are shown in Figure 4. 2 Polygonal coordinates Let Ω R 2 be a convex polygon in the plane, regarded as a closed set, with vertices v 1,v 2,...,v n, n 3, in an anticlockwise ordering. Figure 5 shows an example with n = 5. We will call any set of functions λ i : Ω R, 3

+ v 3 + + + + + + + + v 1 + + v 2 + Figure 4: Signs of λ 1,λ 2,λ 3. v 4 v 3 v 5 Ω v 1 v 2 Figure 5: Example of a convex polygon. 4

i = 1,...,n, barycentric coordinates if they satisfy, for all x Ω, the three properties λ i (x) 0, i = 1, 2,...,n, (7) λ i (x) = 1 (8) and λ i (x)v i = x. (9) In the special case that n = 3, the λ i are the unique triangular coordinates of (5). For n 4, and for general x Ω, there is no unique choice of the n values λ 1 (x),...,λ n (x) that satisfies the three conditions. In most applications we would like functions λ i that are as smooth as possible. Even though barycentric coordinates are not unique for n 4, they share some general properties that follow from the three defining axioms (7), (8) and (9). First, given a function f : Ω R, we can define an approximation g = I(f), by the formula g(x) = λ i (x)f(v i ), x Ω. The operator I has linear precision in the sense that if f is a linear polynomial then g = f. This comes from the barycentric property (9) combined with (8): if f(x) = a x + b, then g(x) = λ i (x)(a v i + b) = a λ i (x)v i + b λ i (x) = f(x). Another property is the Lagrange property, λ i (v j ) = δ ij, and the λ i are linear along each edge of Ω. To see this, observe that since the triangle area A(x,v j,v j+1 ) is linear in x, the linear precision property implies λ i (x)a(v i,v j,v j+1 ) = A(x,v j,v j+1 ), 5

and so if x belongs to the edge [v j,v j+1 ], λ i (x)a(v i,v j,v j+1 ) = 0. i j,j+1 Since A(v i,v j,v j+1 ) > 0 for i j,j + 1 by the convexity of Ω, and since λ i (x) 0 by (7) it follows that λ i (x) = 0 for all i j,j + 1. This implies that from (9), λ j (x)v j + λ j+1 (x)v j+1 = x. 3 Wachspress coordinates These are barycentric coordinates over convex polygons that are rational functions, and are defined by where and λ i (x) = w i (x) n j=1 w, x Ω, (10) j(x) w i (x) = B i j i 1,i A j (x), (11) A i (x) := A(x,v i,v i+1 ) and B i := A(v i 1,v i,v i+1 ). The triangle areas A i and B i are shown in Figure 6. Since A j is linear in x we see that w i is a polynomial of degree n 2. It follows that the numerator of λ i has degree n 2. Thus the denominator, W(x) = w j (x), (12) j=1 has degree at most n 2, but in fact its degree is n 3. This follows from the barycentric property λ i which we prove in the next section. Wachspress coordinates are clearly smooth (C ) and also rational polynomials in the coordinates x 1 and x 2 of the point x = (x 1,x 2 ) with degree at most n 2. We note that in the case that Ω is a regular polygon, the areas B 1,...,B n are equal in which case they can be removed from the formula and we have simply w i (x) = A j (x). (13) j i 1,i 6

v i+1 x B i A i A i 1 v i 1 v i Figure 6: Triangles areas To establish the barycentric property (9) for the Wachspress coordinates (10), it helps first to express the coordinates in a different form. Multiplying w i by a constant in i does not change λ i, and so dividing w i by n j=1 A j gives the alternative form λ i (x) = w i (x) n j=1 w j(x), w i(x) = B i A i 1 (x)a i (x), (14) which is valid for x Int(Ω). In contrast to w i, the rational function w i depends only on the three local vertices v i 1, v i, and v i+1. Theorem 1 With w i as in (14), w i (x)(v i x) = 0, x Int(Ω). (15) Proof. We express x as a barycentric combination of v i 1, v i, and v i+1, x = A i(x) B i v i 1 + (B i A i 1 (x) A i (x)) v i + A i 1(x) v i+1, B i B i and rearrange this equation in the form B i A i 1 (x)a i (x) (v i x) = 1 A i 1 (x) (v i v i 1 ) 1 A i (x) (v i+1 v i ). Summing both sides of this equation over i = 1,...,n gives the result. 7

Figure 7: A Wachspress barycentric mapping The barycentric property (9) follows from this. Another consequence is that w i (x)v i = x w i (x), and so w i (x)v i = x w i (x). Then, since the left hand side is a (vector) polynomial of degree n 2, the sum W(x) = n w i(x) must be a polynomial of degree n 3. 4 Barycentric mapping Barycentric coordinates such as Wachspress coordinates can be used to deform one polygon into another. We can map the source polygon Ω into the target polygon Ω, with vertives v 1,...,v n by the mapping φ(x) = i λ i (x)v i. Figure 11 shows such a Wachspress mapping. Such a mapping can be used to deform a smooth curve. One can enclose the curve in a polygon, and then deform the curve by moving the vertices of the polygon, in a similar way to modelling with Bézier and spline curves. Figure 8 shows the result of applying the mapping above to a circle. 8

Figure 8: Curve deformation 4.1 Wachspress coordinates outside the polygon Do Wachspress coordinates extend outside the polygon? We saw that barycentric coordinates over a triangle continue to be well-defined outside the triangle, even though they are no longer all positive there. Wachspress coordinates, however, may not even be well-defined outside the polygon. Consider the example of Fig 9, where n = 4, and Ω is a quadrilateral. The lines through the fours sides of the quadrilateral intersect in the two points p and q. By definition, we see that A 2 (p) = A 4 (p) = 0. Therefore, w i (p) = 0 for all i = 1, 2, 3, 4, and so W(p) = 0. Similarly, A 1 (q) = A 3 (q) = 0, and so W(q) = 0 We showed earlier that the polynomial W has degree n 2, which in this quadrilateral case is degree 1. Thus, W is zero along the line L through p and q and we conclude that the Wachspress coordinates λ 1,...,λ 4 are not well-defined on the line L. 5 Mean value coordinates Can we find coordinates that are well-defined for points both inside and outside the polygon, and ideally, also for a non-convex polygon? One answer is mean value coordinates. We consider initially the case that Ω is again convex and x is inside. The mean value coordinates of x are then λ i (x) = w i (x) n j=1 w, x Ω, (16) j(x) 9

v 3 v 4 q v 1 v 2 L p Figure 9: Singularities of Wachspress coordinates where w i (x) = tan(α i 1(x)/2) + tan(α i (x)/2), (17) v i x and denotes the Euclidean norm in R 2 and α i (x) is the angle at x in the triangle [x,v i,v i+1 ], illustrated in Figure 10. Note that the tangents in the formula do not need to be evaluated directly. Instead, using the notation d i = v i x, r i = d i, and e i = d i /r i, we can write sin α i = e i e i+1, and cos α i = e i e i+1, where and denote cross and dot products of vectors in R 2, and then use either of the two formulas tan(α/2) = (1 cos α)/ sin α = sinα/(1 + cosα). Nevertheless, the mean value weight (17) requires computing square roots in order to evaluate r i 1, r i, and r i+1. To show that mean value coordinates satisfy the barycentric property (9) it is enough to show 10

v i+1 v i x α i α i 1 v i 1 Figure 10: Angles in mean value formula Theorem 2 With w i as in (17), w i (x)(v i x) = 0, x Int(Ω). (18) Proof. With x Int(Ω) fixed, equation (18) is equivalent to ( tan(αi 1 /2) + tan(α i /2) ) e i = 0, which can be rewritten as tan(α i /2)(e i + e i+1 ) = 0. (19) To show that this equation holds, express the unit vector e i as e i = (cosθ i, sin θ i ). Then α i = θ i+1 θ i, and so ( αi ) ( ) θi+1 θ i tan (e i + e i+1 ) = tan (cos θ i + cos θ i+1, sin θ i + sinθ i+1 ) 2 2 = (sinθ i+1 sin θ i, cos θ i cos θ i+1 ), the last line following from the addition and subtraction formulas for sines and cosines. Summing this expression over i = 1,...,n gives equation (19) as required. 11

Figure 11: A Wachspress barycentric mapping Figure?? shows such a Wachspress mapping. An advantage of mean value coordinates over Wachspress coordinates is that they are well defined (and positive) even when Ω is a star-shaped polygon, as long as x is in its kernel. This means that mean value coordinates can be used to express a vertex in a planar triangular mesh as a convex combination of its neighbouring vertices. This was the original motivation for mean value coordinates and they have used for this purpose in order to parameterize (non-planar) triangular meshes. Another advantage of mean value coordinates, is that they are still welldefined, though not in general positive, for arbitrary polygons, and in fact for any x in R 2, provided that the angle α i in the formula is taken to be the signed angle formed by the two vectors v i x and v i+1 x. The coordinates are not in general positive, but they still sum to one and have the Lagrange property on the boundary of the polygon. This means that they can be used for deforming polygons, even when the source polygon is not convex. Figure 12 show the use of mean value coordinates to deform a digital image (to straighten the leaning tower of pisa). 12

Figure 12: Image warping using MV coordinates. 13