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

A Condition Number for Bézier Curve Intersection

view repo

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

READ FULL TEXT VIEW PDFA Condition Number for Bézier Curve Intersection

view repo

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 literature^{1}^{1}1As 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.

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

(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

(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

(2.3) |

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

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

(3.1) |

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

(3.2) |

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

(3.3) |

This gives

(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

(3.5) |

With this, we can define a root condition number

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

(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

(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.

When , due to the triangle inequality:

(3.8) |

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

(3.9) |

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

(3.10) |

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

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

(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.

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

(4.2) |

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

(4.3) |

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

(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

(4.5) |

where

(4.6) | ||||

(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

(4.8) | ||||

(4.9) |

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

To find interior critical points, we solve the system :

(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

(4.11) |

Note that , so

(4.12) |

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

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

(4.13) | |||||

(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:

(4.15) | ||||

(4.16) |

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

(4.17) |

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

(4.18) |

At the solution , we have

(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 .

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

(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

(4.21) |

that increases towards infinity as the parameter .

- [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.

Comments

There are no comments yet.