A Condition Number for Bézier Curve Intersection
A Condition Number for Bézier Curve Intersection
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.
Throughout, we’ll refer to a Bézier curve as a parametric plane curve given by
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
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
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
Since , if exists at then the implicit function theorem tells us that we can define via
Taking the derivative with respect to we find that . Plugging in we find that , hence we conclude that
as the relative condition number for a perturbation in . By considering perturbations in all of the coefficients: , a similar analysis gives a root function
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
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
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:
The sign and magnitude of each can be chosen to make , hence for these values equality holds in the triangle inequality:
Thus we get a root condition number for a polynomial given in Bernstein form
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
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
Then the root condition number of the intersection is the greater of two vector norms:
Let the curve be degree and be degree . Then can be written as terms:
Since we have Jacobian . Since a transversal intersection, we have . In a perturbation, we replace each with a bounded by . Writing , we have
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
Now we seek to maximize the objective function in the rectangle .
To find interior critical points, we solve the system :
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
Note that , so
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
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:
Consider the intersection of the lines and when . These correspond to the Bézier curves
By adding a scalar to each component, we leave and hence the solution unchanged. However, the coefficients of the curves change:
At the solution , we have
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:
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
that increases towards infinity as the parameter .