# A 2-Norm Condition Number for Bézier Curve Intersection

We present a short note describing a condition number of the intersection of two Bézier curves.

## Authors

• 3 publications
12/20/2018

### Intersections between the norm-trace curve and some low degree curves

In this paper we analyze the intersection between the norm-trace curve o...
01/21/2000

### Bezier Curves Intersection Using Relief Perspective

Presented paper describes the method for finding the intersection of cla...
04/04/2019

### Embeddings of k-complexes into 2k-manifolds

If K is a simplicial k-complex, the standard van Kampen obstructions tel...
03/16/2019

### Computing the intersection of two quadrics through projection and lifting

This paper is devoted to presenting a method to determine the intersecti...
01/08/2013

### On Intersecting IFS Fractals with Lines

IFS fractals - the attractors of Iterated Function Systems - have motiva...
02/06/2017

### Discriminants of complete intersection space curves

In this paper, we develop a new approach to the discrimi-nant of a compl...
06/08/2018

### The Saturated Subpaths Decomposition in Z 2 : a short note on generalized Tangential Cover

In this short note, we generalized the Tangential Cover used in Digital ...

## Code Repositories

### condition-number-bezier-curve-intersection

A Condition Number for Bézier Curve Intersection

##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1 Introduction

The problem of intersecting two planar Bézier curves is an important one in Computer Aided Geometric Design (CAGD). Many intersection algorithms have been described in the literature, both geometric ([SP86, SN90, KLS98]) and algebraic ([MD92]). Though the general convergence properties of these algorithms have been studied (e.g. [Sch09]), no condition number for the intersection problem has been described in the CAGD literature111As far as the author has been able to tell. In many CAGD textbooks, there is a long review of methods for intersecting two planar Bézier curves (e.g. [Far01, Sed16]) but no mention of conditioning..

There are more generic condition numbers for rational polynomial systems ([HT15]) or nonlinear algebraic systems ([Hig02, Chapter 25, Section 25.4]). However, the condition numbers with an algebraic focus (rather than an analytic one) often require too much computation to be useful. The numerical analytic condition numbers are in some ways too general to be useful for planar Bézier curve intersection.

In this paper, we describe a simple relative root condition number for this intersection problem. Since tangent intersections are to transversal intersections as multiple roots are to simple roots of a function, this condition number is infinite for non-transversal intersections. We present a few examples verifying that the condition number increases as a family of intersections approach an ill-behaved intersection.

## 2 Preliminaries

Throughout, we’ll refer to a Bézier curve as a parametric plane curve given by

 b(s)=n∑j=0bjBj,n(s) (2.1)

where is a Bernstein polynomial. When the parameter , the coefficients as well and the evaluation is a convex combination of the set of control points .

A Bézier curve intersection is a root of the function

 F(s,t)=b0(s)−b1(t) (2.2)

where and are Bézier curves. Note that .

Each component and of a Bézier curve is a polynomial in Bernstein form. For such a polynomial

 p(s)=n∑j=0pjBj,n(s) (2.3)

the (absolute) condition number of evaluation is ([FR87]) when the parameter is in the unit interval.

## 3 Conditioning of Generic Root-finding

Consider a smooth function with Jacobian . We want to consider a special class of functions of the form where the basis functions are also smooth functions on and each . We want to consider the effects on a root of a perturbation in one of the coefficients . We examine the perturbed function

 G(x,δ)=F(x)+δϕj(x). (3.1)

Since , if exists at then the implicit function theorem tells us that we can define via

 G(x(δ),δ)=0. (3.2)

Taking the derivative with respect to we find that . Plugging in we find that , hence we conclude that

 x(δ)=α−J(α)−1ϕj(α)δ+O(δ2). (3.3)

This gives

 ∥∥J(α)−1ϕj(α)∥∥∥α∥. (3.4)

as the relative condition number for a perturbation in . By considering perturbations in all of the coefficients: , a similar analysis gives a root function

 x(δ0,…,δn)=α−J(α)−1n∑j=0δjϕj(α)+O(ε2). (3.5)

With this, we can define a root condition number

###### Definition 3.1.

For a smooth function parameterized by the coefficients with root and Jacobian , we define a relative root condition number

 κα=limsupε→0∥δα∥/ε∥α∥=limε→0⎛⎝sup∣∣δj∣∣≤ε∣∣cj∣∣∥∥J(α)−1∑jδjϕj(α)∥∥/ε∥α∥⎞⎠. (3.6)

In [Hig02, Chapter 25, Section 25.4]

a similar definition is given. Instead of bounding the perturbations component-wise, it bounds the entire perturbation vector

 limε→0⎛⎝sup∥δ∥≤ε∥c∥∥∥J(α)−1∑jδjϕj(α)∥∥/ε∥α∥⎞⎠=∥∥J−1Fc∥∥∥c∥∥α∥. (3.7)

While this has the benefit of having a closed form that is straightforward to compute, it may be less useful than the condition number given in Definition 3.1 since the larger coefficients can dominate the rest.

### 3.1 One-dimensional Case

When , due to the triangle inequality:

 |δα|=∣∣ ∣∣J−1n∑j=0δjϕj(α)∣∣ ∣∣≤1|F′(α)|n∑j=0∣∣δjϕj(α)∣∣. (3.8)

The sign and magnitude of each can be chosen to make , hence for these values equality holds in the triangle inequality:

 ∣∣ ∣∣n∑j=0δjϕj(α)∣∣ ∣∣=εn∑j=0∣∣cjϕj(α)∣∣. (3.9)

Thus we get a root condition number for a polynomial given in Bernstein form

 κα=1|αF′(α)|n∑j=0∣∣cjϕj(α)∣∣. (3.10)

that agrees with the common definition ([FR87]) when the are specialized to Bernstein basis functions.

## 4 Conditioning of Bézier Curve Intersection

To define a condition number for the intersection of two planar Bézier curves, we write the difference as

 F(s,t)=[x0(s)0]+[0y0(s)]−[x1(t)0]−[0y1(t)]. (4.1)

We can show that there is a closed form for the condition number given by Definition 3.1, specialized to the 2-norm.

###### Theorem 4.1.

Let be a transversal intersection of two planar Bézier curves and . Define the vectors

 ˜F+=[˜x0(α)+˜x1(β)˜y0(α)+˜y1(β)]%and˜F−=[˜x0(α)+˜x1(β)−˜y0(α)−˜y1(β)]. (4.2)

Then the root condition number of the intersection is the greater of two vector norms:

 (4.3)
###### Proof.

Let the curve be degree and be degree . Then can be written as terms:

 F(s,t)=m∑i=0c(1)i[Bi,m(s)0]+m∑i=0c(2)i[0Bi,m(s)]+n∑j=0c(3)j[−Bj,n(t)0]+n∑j=0c(4)j[0−Bj,n(t)]. (4.4)

Since we have Jacobian . Since a transversal intersection, we have . In a perturbation, we replace each with a bounded by . Writing , we have

 J(α)−1∑jδjϕj(α)=[m∑i=0δ(1)iBi,m(α)+n∑j=0δ(3)jBj,n(β)]v+[m∑i=0δ(2)iBi,m(α)+n∑j=0δ(4)jBj,n(β)]w=ν1v+ν2w (4.5)

where

 |ν1|/ε ≤m∑i=0∣∣c(1)i∣∣Bi,m(α)+n∑j=0∣∣c(3)j∣∣Bj,n(β)=˜x0(α)+˜x1(β)=μ1 (4.6) |ν2|/ε ≤m∑i=0∣∣c(2)i∣∣Bi,m(α)+n∑j=0∣∣c(4)j∣∣Bj,n(β)=˜y0(α)+˜y1(β)=μ2. (4.7)

As in (3.8), the bound can be attained by choosing the sign and magnitude of each perturbation so that . The factor of can be cancelled to give condition number

 κα,β =1√α2+β2sup|νk|≤μk∥ν1v+ν2w∥2 (4.8) = ⎷sup|νk|≤μkν21(v⋅v)+2ν1ν2(v⋅w)+ν22(w⋅w)α2+β2. (4.9)

Now we seek to maximize the objective function in the rectangle .

To find interior critical points, we solve the system :

 [2v⋅v2v⋅w2v⋅w2w⋅w][ν1ν2]=[00]. (4.10)

This system has the unique solution unless . By the Cauchy-Schwarz inequality, this can only occur if and are parallel; since is invertible, we know they are not. Hence is the only interior critical point and it is the global minimum.

Along the boundary of the rectangle, we fix one of or and the resulting univariate function is an up-opening parabola. For example, fixing gives which has positive lead coefficient . The lead coefficient cannot be since if were the zero vector we’d have . Since is an up-opening parabola along the boundary, any critical point must be a local minimum.

Thus we know the maximum occurs at two of the four corners of the rectangle. Due to sign cancellation, this leads to one of two values , the largest of which is . Thus

 κα,β=√μ21(v⋅v)+2μ1μ2|v⋅w|+μ22(w⋅w)α2+β2. (4.11)

Note that , so

 ∥∥J(α,β)−1˜F±∥∥2=∥∥[vw]˜F±∥∥2=√μ21(v⋅v)±2μ1μ2(v⋅w)+μ22(w⋅w) (4.12)

gives each of the two values that produce the maximum value.

### 4.1 Transversal Intersection

Consider the line and improperly parameterized line which intersect at . At the intersection we have , so that and . Since the -component of can be written as and the -component as we have

 μ1 =2B1,1(α) +4B2,2(β)=2 (4.13) μ2 =2B1,1(α)+2B0,2(β)+2B1,2(β) +2B2,2(β)=3. (4.14)

Following (4.11), this gives . This low condition number is somewhat unexpected since when using the resultant to eliminate each parameter, one of the two roots is a double root:

 Rest(x0(s)−x1(t),y0(s)−y1(t)) =64(2s−1)2 (4.15) Ress(x0(s)−x1(t),y0(s)−y1(t)) =4(2t−1)(2t+1). (4.16)

### 4.2 Line-line Intersection with Poorly Behaved Coefficients

Consider the intersection of the lines and when . These correspond to the Bézier curves

 b0(s)=[ss],b1(t)=[t1−t]. (4.17)

By adding a scalar to each component, we leave and hence the solution unchanged. However, the coefficients of the curves change:

 b0(s)=[D(1−s)+(1+D)sD(1−s)+(1+D)s],b1(t)=[D(1−t)+(1+D)t(1+D)(1−t)+Dt]. (4.18)

At the solution , we have

 ˜F±=[2D+1±(2D+1)] (4.19)

and in either case .

So, we see the condition number increases towards infinity as does. This is what we expect as the coefficients grow so large that their ratio approaches .

### 4.3 Family of Lines Approaching Coincident

Consider a family of intersections in which one of the lines approaches the other:

 b0(s)=[s1],b1(t)=[t(1+r)(1−t)+t]. (4.20)

These lines and intersect when . However as , the lines become coincident: if the single intersection becomes infinitely many.

At the solution, we have and again have a condition number

 κα,β=√4r2+4r+2=2r+1+r4+O(r2). (4.21)

that increases towards infinity as the parameter .

## References

• [Far01] Gerald Farin. Curves and Surfaces for CAGD, Fifth Edition: A Practical Guide (The Morgan Kaufmann Series in Computer Graphics). Morgan Kaufmann, 2001.
• [FR87] R.T. Farouki and V.T. Rajan. On the numerical condition of polynomials in Bernstein form. Computer Aided Geometric Design, 4(3):191–216, Nov 1987.
• [Hig02] Nicholas J. Higham. Accuracy and Stability of Numerical Algorithms. Society for Industrial and Applied Mathematics, Jan 2002.
• [HT15] Aaron Herman and Elias Tsigaridas. Bounds for the condition number of polynomials systems with integer coefficients. In Computer Algebra in Scientific Computing, pages 210–219. Springer International Publishing, 2015.
• [KLS98] Deok-Soo Kim, Soon-Woong Lee, and Hayong Shin. A cocktail algorithm for planar Bézier curve intersections. Computer-Aided Design, 30(13):1047–1051, Nov 1998.
• [MD92] Dinesh Manocha and James W. Demmel. Algorithms for Intersecting Parametric and Algebraic Curves. Technical Report UCB/CSD-92-698, EECS Department, University of California, Berkeley, Aug 1992.
• [Sch09] Christian Schulz. Bézier clipping is quadratically convergent. Computer Aided Geometric Design, 26(1):61–74, Jan 2009.
• [Sed16] Thomas W Sederberg. Lecture notes: Computer aided geometric design, Sep 2016.
• [SN90] T.W. Sederberg and T. Nishita. Curve intersection using Bézier clipping. Computer-Aided Design, 22(9):538–549, Nov 1990.
• [SP86] Thomas W Sederberg and Scott R Parry. Comparison of three curve intersection algorithms. Computer-Aided Design, 18(1):58–63, Jan 1986.