Geometric Properties and Algorithms for Rational q-Bézier Curves and Surfaces

In this paper, properties and algorithms of q-Bézier curves and surfaces are analyzed. It is proven that the only q-Bézier and rational q-Bézier curves satisfying the boundary tangent property are the Bézier and rational Bézier curves, respectively. Evaluation algorithms formed by steps in barycentric form for rational q-Bézier curves and surfaces are provided.


Introduction
The q-Bernstein basis of polynomials for some 0 < q ≤ 1 (see [1]) plays an important role in several areas, such as Approximation Theory and Computer Aided Design. Its impact is shown by many recent publications (see [2,3] and references in there). When q = 1, the basis is the Bernstein basis.
Let us now introduce some notations and definitions. Let U be a vector space of real functions defined on a real interval I = [a, b] and U = (u 0 (t), . . . , u n (t)) (t ∈ I) a basis of U . If a sequence P 0 , . . . , P n of points in R k is given then we define a curve γ(t) = ∑ n i=0 P i u i (t), t ∈ I. The points P 0 , . . . , P n are called control points and the corresponding polygon P 0 · · · P n is called the control polygon of γ. In Computer-Aided Geometric Design (CAGD), it is desirable that a basis U satisfies the endpoint interpolation property and also the boundary tangent property. When the curve γ starts at P 0 and ends at P n for any control polygon, it is said that the basis U satisfies the endpoint interpolation property: γ(a) = P 0 , γ(b) = P n . When the first segment of the control polygon, P 0 P 1 , and the last segment of the control polygon, P n−1 P n , are tangent to the curve γ at the endpoints a and b, respectively, then the basis U is said to satisfy the boundary tangent property.
For curve design purposes, a basis U has to be normalized (i.e., it forms a partition of the unity: ∑ n i=0 u i (t) = 1 for all t ∈ I) and nonnegative (i.e., u i (t) ≥ 0 for all t ∈ I and i = 0, . . . , n). It is well known in CAGD that a curve representation presents nice properties when the corresponding normalized basis is totally positive, that is, when all its collocation matrices have nonnegative minors (see [4,5]).
The Bernstein polynomials b n i (x), i = 0, 1, . . . , n, of degree n are defined as The Bernstein polynomials (b n 0 , . . . , b n n ) form a normalized totally positive basis of the space of polynomials of degree at most n, Π n . From the Bernstein polynomials we can construct a Bézier curve as In [1] Phillips introduced a generalization of the Bernstein polynomials based on q-integers. Given a positive real number q we define a q-integer [r] as [r] = 1 + q + · · · + q r−1 = 1−q r 1−q , if q = 1, r, if q = 1.
Then we define a q-factorial [r]! (see [6]) as and finally, we define the q-binomial coefficient as for integers n ≥ r ≥ 0 and as zero otherwise. The q-Bernstein polynomials of degree n for 0 < q ≤ 1 are defined as These polynomials B q = (b n 0,q , b n 1,q , . . . , b n n,q ), as the usual Bernstein polynomials, also form a basis of Π n . Let us observe that for the case q = 1 the q-Bernstein polynomials coincide with the Bernstein polynomials. In [7] algorithms with high relative accuracy for solving some algebraic problems for the collocation matrices of q-Bernstein polynomials were devised.
It is well known that Bézier curves satisfy the endpoint interpolation property and also the boundary tangent property. In [8] it was shown that all rational q-Bernstein bases also satisfy the endpoint interpolation property. Section 2 recalls basic properties and algorithms of q-Bézier curves. In Section 3 we prove that the Bernstein basis is the unique basis among all q-Bernstein bases satisfying the geometric boundary tangent property. In Section 4 we recall some basic properties and algorithms of rational q-Bézier curves, analyzing and providing some new properties and algorithms. We prove that the Bernstein basis is the unique basis among all q-Bernstein bases satisfying the geometric boundary tangent property.
Algorithms formed by steps in barycentric form (that is, with real coefficients that sum up to 1) are very important in CAGD. In Section 4 we provide an algorithm with this property for rational q-Bézier curves and, in Theorem 4, we relate it with the algorithm provided in [8], which does not satisfy the property. Section 5 presents an evaluation algorithm also formed by steps in barycentric form for rational q-Bézier surfaces. Finally, in Section 6 we summarize the main conclusions of the paper.

q-Bézier Curves
Analogously to the case of Bézier curves we can define a q-Bézier curve as where the q-Bernstein polynomials are given by (2). Observe that for q = 1 we have the usual Bézier curve.

Properties of q-Bézier Curves
In this subsection we summarize some basic properties satisfied by q-Bézier curves either recalling where they were announced or mentioning a sketch of the proof.

•
The q-Bernstein polynomials form a partition of unity: This property can be proved by induction by evaluating ∑ n i=0 b n i,q (x) through Algorithm 2.

•
The q-Bernstein polynomials are nonnegative Convex hull property: A q-Bézier curve is always contained inside the convex hull of its control points (see Section 2 of [8] for the case of rational q-Bézier curves; q-Bézier curves are a particular case of these curves). • Invariance under barycentric combinations: • Linear precision: See Proposition 5.2 of [9].
• q-Bézier curves satisfy the variation diminishing property: the q-Bézier curve has no more intersections with any line than its control polygon (see Section 2 of [10]).

q-Casteljau Algorithms
Given a sequence of control points (P i ) 0≤i≤n in R 2 or R 3 , the q-Bézier curve (3) can be evaluated by Algorithm 1 as pointed out in [11].
The previous algorithm is not formed by steps in barycentric form. In Section 2 of [12], a second de Casteljau type algorithm for computing the q-Bézier curves was given. We call it Algorithm 2.
We can observe that the previous algorithm is formed by steps in barycentric form. Although both algorithms, Algorithms 1 and 2, evaluate the same q-Bézier curve, the intermediate points are different and are related in the following form: f (see Section 2 of [12]).

Algorithm 2 Evaluation of a q-Bézier curve
i+1 (x) end for end for Theorem 1. Let γ(x) be a q-Bézier curve of degree n given by (3) and let c ∈ (0, 1). Then the part of the curve that corresponds to the interval [0, c], denoted by γ [0,c] (x), is given by where quantities f 0 (c) are computed from Algorithm 1 and Algorithm 2, respectively.

Degree Elevation of q-Bézier Curves
The q-Bézier curve (3) is a polynomial curve of degree n. If the curve does not possess sufficient flexibility to model the desired shape, the degree of the curve must be elevated. So, in [10] the following result was presented.

Remark 1.
Control points P r i in the previous theorem can also be computed by applying the following recursive algorithm where P 0 i = P i for i = 0, 1, . . . , n.

Boundary Tangent Property for q-Bézier Curves
In this subsection we prove that the boundary tangent property holds for q-Bézier curves if and only if q = 1, that is, for Bézier curves.
In order to study the boundary tangent property for q-Bézier curves we first need to compute

Proposition 1. Given the q-Bernstein basis
Proof. Differentiating the i-th q-Bernstein polynomial (2) we have Evaluating the previous expression at x = 0 we have for i = 0 and 1 that and for i ∈ {2, . . . , n} that (b n i,q ) (0) = 0. Analogously, evaluating (4) at x = 1 we have for i = 0 that and for i = n that (b n n,q ) (1) = n n n = n and the result follows.
Then, as a consequence of the previous result we have the following expressions for the derivatives of a q-Bézier curve at the endpoints.

Corollary 1. Given the q-Bézier curve γ(x) defined by (3) we have
From the previous result we can conclude that the first segment of the control polygon of any q-Bézier curve, P 0 P 1 , is tangent to the curve at x = 0 but, in general, the last segment, P n−1 P n , is not tangent to the curve at x = 1. In the following result we determine the values of q such that the corresponding q-Bernstein bases satisfy the boundary tangent property. Proof. By Corollary 1 a q-Bézier curve will satisfy the boundary tangent property if and only if the last segment of the control polygon, P n−1 P n is tangent to the curve γ at x = 1, that is, if there exists a value k such that γ (1) = k(P n − P n−1 ) for any control polygon. From Corollary 1 we deduce that a q-Bézier curve satisfies the boundary tangent property if and only if These last two expressions hold if and only if q = 1 and the result follows. Figure 1 illustrates the boundary tangent property of q-Bernstein bases. We can observe that the theoretical results are confirmed: P 0 P 1 is tangent to all the q-Bézier curves at x = 0, whereas P n−1 P n is only tangent to the Bézier curve at the other endpoint x = 1.
From the previous result we can conclude that the first segment of the control polygon of any 115 q-Bézier curve, P 0 P 1 , is tangent to the curve at x = 0 but, in general, the last segment, P n−1 P n , is not 116 tangent to the curve at x = 1. In the following result we determine the values of q such that the 117 corresponding q-Bernstein bases satisfy the boundary tangent property.

Rational q-Bézier Curves
In [8] rational q-Bézier curves were presented as a generalization of rational Bézier curves. Given a sequence (w i ) n i=0 of strictly positive weights, a rational q-Bernstein basis (r n 0 , . . . , r n n ) was defined as and a rational q-Bézier curve as where P i ∈ R k (k = 2 or 3) are the control points of the curve.

Properties of Rational q-Bézier Curves
We now summarize some basic properties of rational q-Bézier curves.
• Invariance under barycentric combinations: • The rational functions (r n 0,q , . . . , r n n,q ) form a normalized totally positive basis of the corresponding space of functions since any collocation matrix of this system of functions can be expressed as the product of three totally positive matrices and so it is totally positive. In fact, if we consider a collocation matrix of the system (5), it can be expressed as the product of the corresponding collocation matrix of the system (b n 0,q , . . . , b n n,q ) premultiplied and post multiplied by diagonal matrices with positive diagonal entries.
• Rational q-Bézier curves satisfy the variation diminishing property: the rational q-Bézier curve has no more intersections with any line than its control polygon. This property is a consequence of the previous one.

q-Casteljau Algorithms for Rational q-Bézier Curves
In Algorithm 2.1 of [8] an algorithm for the evaluation of rational q-Bézier curves was also presented. We call it Algorithm 3.

end for end for
Algorithm 3 arose as a generalization of Algorithm 1 for rational q-Bézier curves. In particular, in [8] the following result was provided.

Theorem 3. Each intermediate point f (r)
i (x) of Algorithm 3 can be expressed as Analogously, we can generalize Algorithm 2 obtaining Algorithm 4.

Algorithm 4 Evaluation of a rational q-Bézier curve
Require: (P i ) 0≤i≤n , (w i ) 0≤i≤n , q ∈ (0, 1] i (x) = w i end for for r = 1 to n do for i = 0 to n − r do w (r)

end for end for
We can observe that Algorithm 4 is an algorithm formed by steps in barycentric form in contrast to Algorithm 3. The following result relates both algorithms.
Proof. Let us prove it by induction on r ∈ {1, . . . , n}. For r = 1 we have by Algortihm 4 From the previous expression, by Algorithm 3 and taking into account that w that is, the first equation in (7) for r = 1. Again by Algortihm 4 for r = 1 we have Substituting (8) in the previous formula, by Algorithm 3 and taking into account that w that is, the second equation in (7) for r = 1. Now let us assume that formulas in (7) hold for some r ∈ {1, . . . , n − 1} and let us prove them for r + 1. For r + 1 we have, by Algorithm 4, that By the induction hypothesis we have that w (r) i (x). Applying this fact in the previous formula we have and, by Algorithm 3, we conclude that is, the first formula in (7) for r + 1. Again by Algortihm 4 for r + 1 we have Substituting (9) in the previous formula, taking into account that w (r) i (x) and by Algorithm 3 we deduce that that is, the second equation in (7) for r + 1 and the theorem holds.
As a consequence of the previous theorem and Theorem 3, the following result follows.

Corollary 3. Each intermediate point f (r)
i (x) of Algorithm 4 can be expressed as In Theorem 3.2 of [8] a result on subdivision of rational q-Bézier curves was stated. So, taking into account that result and (7) we have the following result.

Theorem 5.
Let γ(x) be a rational q-Bézier curve of degree n given by (6) and let c ∈ (0, 1). Then the part of the curve that corresponds to the interval [0, c] denoted by γ [0,c] (x) is given by where quantities w

Boundary Tangent Property for Rational q-Bézier Curves
At the beginning of this section, it was recalled that rational q-Bernstein bases satisfy the endpoint interpolation property. Now let us analyze the boundary tangent property. The following result provides the derivatives of a rational q-Bézier curve at the endpoints.
Analogously to the nonrational case we can derive the following result.

Corollary 4.
The rational q-Bernstein basis (b n 0,q , . . . , b n n,q ) satisfies the boundary tangent property if and only if q = 1, that is, if and only if it is the corresponding rational Bernstein basis. Figure 2 illustrates the boundary tangent property of rational q-Bernstein bases. For the example we have considered the same control points as in the example illustrating the boundary tangent property of q-Bernstein bases with weigths (w i ) 0≤i≤4 = (1, 15, 30, 15, 1). As in that case, we can observe that the theoretical results are confirmed: P 0 P 1 is tangent to all the rational q-Bézier curves at x = 0, whereas P n−1 P n is only tangent to the rational Bézier curve at the other endpoint x = 1.

192
Analogously to the nonrational case we can derive the following result. At the end of Section 3 in [4] it was shown briefly how to elevate by 1 the degree of rational 202 q-Bézier curves. In the following result this procedure is generalized. 203 Theorem 6. Let γ(x) be the rational q-Bézier curve (6) with (P i ) 0≤i≤n a sequence of control points in R 2 or 204 R 3 and (w i ) 0≤i≤n a sequence of strictly positive weights. Then where, for n ≥ 3, for k = 1, 2, . . . , r, and i = 0, 1, . . . , n + k with w 0 i = w i and P 0 i = P i for i = 0, 1, . . . , n.

Degree Elevation of Rational q-Bézier Curves
At the end of Section 3 in [8] it was shown briefly how to elevate by 1 the degree of rational q-Bézier curves. In the following result this procedure is generalized. Theorem 6. Let γ(x) be the rational q-Bézier curve (6) with (P i ) 0≤i≤n a sequence of control points in R 2 or R 3 and (w i ) 0≤i≤n a sequence of strictly positive weights. Then where, for n ≥ 3, where, for k = 1, 2, . . . , r and i = 0, 1, . . . , n + k, with w 0 i = w i and f 0 i = f i for i = 0, 1, . . . , n. Then, taking P k i = f k i /w k i the result follows.
Now let us consider the evaluation of q-Bézier rational surfaces. The rational q-Bézier surface in (12) can be written as ∑ n j=0 w ij b n j,q 2 (y) b m i,q 1 (x) ∑ m i=0 ∑ n j=0 w ij b n j,q 2 (y) b m i,q 1 (x) .