Next Article in Journal
Approximation of Finite Hilbert and Hadamard Transforms by Using Equally Spaced Nodes
Next Article in Special Issue
Normal Partner Curves of a Pseudo Null Curve on Dual Space Forms
Previous Article in Journal
A Modified Ren’s Method with Memory Using a Simple Self-Accelerating Parameter

Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

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

by
1,*,† and
J. M. Peña
2,†
1
2
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Mathematics 2020, 8(4), 541; https://doi.org/10.3390/math8040541
Submission received: 2 March 2020 / Revised: 30 March 2020 / Accepted: 1 April 2020 / Published: 7 April 2020

## Abstract

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

## 1. 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 ) = ∑ i = 0 n 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: $∑ i = 0 n 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 i n ( x )$, $i = 0 , 1 , … , n$, of degree n are defined as
$b i n ( x ) = n i x i ( 1 − x ) n − i , x ∈ [ 0 , 1 ] .$
The Bernstein polynomials $( b 0 n , … , 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
$γ ( x ) = ∑ i = 0 n P i b i n ( x ) , x ∈ [ 0 , 1 ] .$
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
$[ r ] ! = [ r ] · [ r − 1 ] ⋯ [ 1 ] , if r ∈ N , 1 , if r = 0$
and finally, we define the q-binomial coefficient as
$n r = [ n ] [ n − 1 ] ⋯ [ n − r + 1 ] [ r ] ! = [ n ] ! [ r ] ! [ n − r ] !$
for integers $n ≥ r ≥ 0$ and as zero otherwise. The q-Bernstein polynomials of degree n for $0 < q ≤ 1$ are defined as
$b i , q n ( x ) = n i x i ∏ s = 0 n − i − 1 ( 1 − q s x ) , x ∈ [ 0 , 1 ] , i = 0 , 1 , … , n .$
These polynomials $B q = ( b 0 , q n , b 1 , q n , … , b n , q n )$, 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.

## 2. q-Bézier Curves

Analogously to the case of Bézier curves we can define a q-Bézier curve as
$γ ( x ) = ∑ i = 0 n P i b i , q n ( x ) , x ∈ [ 0 , 1 ] ,$
where the q-Bernstein polynomials are given by (2). Observe that for $q = 1$ we have the usual Bézier curve.

#### 2.1. 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:
$∑ i = 0 n b i , q n ( x ) = 1 for all x ∈ [ 0 , 1 ] .$
This property can be proved by induction by evaluating $∑ i = 0 n b i , q n ( x )$ through Algorithm 2.
• The q-Bernstein polynomials are nonnegative: $b i , q n ( x ) ≥ 0$ for all $x ∈ [ 0 , 1 ]$.
• 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).
• Affine invariance.
• Endpoint interpolation property: This is a consequence of the identities
$b 0 , q n ( 0 ) = 1 , b i , q n ( 0 ) = 0 i = 1 , … , n , b i , q n ( 1 ) = 0 i = 0 , 1 , … , n − 1 , b n , q n ( 1 ) = 1 .$
• Invariance under barycentric combinations:
$∑ i = 0 n ( α P i + β Q i ) b i , q n ( x ) = α ∑ i = 0 n P i b i , q n ( x ) + β ∑ i = 0 n Q i b i , q n ( x ) , α + β = 1 .$
• Linear precision:
$∑ i = 0 n [ i ] [ n ] b i , q n ( x ) = x .$
See Proposition 5.2 of [9].
• The q-Bernstein polynomials of degree n, $( b 0 , q n , … , b n , q n )$, form a normalized totally positive basis (see Section 2 of [10]).
• 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]).

#### 2.2. 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 ¯ i ( r ) = q − r i f i ( r )$ (see Section 2 of [12]).
 Algorithm 1 Evaluation of a q-Bézier curve Require:$( P i ) 0 ≤ i ≤ n$, $q ∈ ( 0 , 1 ]$, $x ∈ [ 0 , 1 ]$Ensure:$f 0 ( n ) ( x ) = γ ( x )$ for $i = 0$ to n do  $f i ( 0 ) ( x ) = P i$ end for for $r = 1$ to n do  for $i = 0$ to $n − r$ do   $f i ( r ) ( x ) = ( q i − q r − 1 x ) f i ( r − 1 ) ( x ) + x f i + 1 ( r − 1 ) ( x )$  end for end for
An important property of the de Casteljau algorithm in CAGD is subdivision. From Theorem 3.2 of [8] with $w i = 1$ for all i and since $f 0 ( i ) = f ¯ 0 ( i )$ for $i = 0 , 1 , … , n$, we derive the following result on subdivision of q-Bézier curves.
 Algorithm 2 Evaluation of a q-Bézier curve Require:$( P i ) 0 ≤ i ≤ m$, $q ∈ ( 0 , 1 ]$, $x ∈ [ 0 , 1 ]$Ensure:$f ¯ 0 ( n ) ( x ) = γ ( x )$ for $i = 0$ to n do  $f ¯ i ( 0 ) ( x ) = P i$ end for for $r = 1$ to n do  for $i = 0$ to $n − r$ do   $f ¯ i ( r ) ( x ) = ( 1 − q r − i − 1 x ) f ¯ i ( r − 1 ) ( x ) + x q r − i − 1 f ¯ i + 1 ( r − 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
$γ [ 0 , c ] ( x ) = ∑ i = 0 n f 0 ( i ) ( c ) b i , q n ( x ) = ∑ i = 0 n f ¯ 0 ( i ) ( c ) b i , q n ( x ) , x ∈ [ 0 , 1 ] ,$
where quantities $f 0 ( i ) ( c )$ and $f ¯ 0 ( i ) ( c )$ are computed from Algorithm 1 and Algorithm 2, respectively.

#### 2.3. 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.
Theorem 2.
(cf. Theorem 3.1 of [10]) Let $γ ( x )$ be the q-Bézier curve (3) with $( P i ) 0 ≤ i ≤ n$ a sequence of control points in $R 2$ or $R 3$. Then
$γ ( x ) = ∑ i = 0 n + r P i r b i , q n + r ( x ) ,$
where, for $n ≥ 3$ and $i = 0 , 1 , … , n + r$,
$P i r = ∑ j = 0 n q ( i − j ) ( n − j ) n j r i − j n + r i P j .$
Remark 1.
Control points $P i r$ in the previous theorem can also be computed by applying the following recursive algorithm
$P i k = 1 − [ n + r − i ] [ n + r ] P i − 1 k − 1 + [ n + r − i ] [ n + r ] P i k − 1 k = 1 , 2 , … , r , i = 0 , 1 , … , n + r ,$
where $P i 0 = P i$ for $i = 0 , 1 , … , n$.

## 3. 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 $( b i , q n ) ′ ( 0 )$ and $( b i , q n ) ′ ( 1 )$ for $i = 0 , 1 , … , n$.
Proposition 1.
Given the q-Bernstein basis $( b 0 , q n , … , b n , q n )$ we have
$− ( b 0 , q n ) ′ ( 0 ) = ( b 1 , q n ) ′ ( 0 ) = [ n ] , ( b i , q n ) ′ ( 0 ) = 0 for i = 2 , … , n , ( b i , q n ) ′ ( 1 ) = − n i ∏ s = 1 n − i − 1 ( 1 − q s ) for i = 0 , 1 , … , n − 1 , ( b n , q n ) ′ ( 1 ) = n .$
Proof.
Differentiating the i-th q-Bernstein polynomial (2) we have
$( b i , q n ) ′ ( x ) = i n i x i − 1 ∏ s = 0 n − i − 1 ( 1 − q s x ) − n i x i ∑ s = 0 n − i − 1 q s ∏ j = 0 ; j ≠ s n − i − 1 ( 1 − q j x ) .$
Evaluating the previous expression at $x = 0$ we have for $i = 0$ and 1 that
$( b 0 , q n ) ′ ( 0 ) = − n 0 ∑ s = 0 n − i − 1 q s ∏ j = 0 ; j ≠ s n − i − 1 ( 1 − q j · 0 ) = − n 0 ∑ s = 0 n − i − 1 q s = − 1 − q n 1 − q = − [ n ] , ( b 1 , q n ) ′ ( 0 ) = n 1 ∏ s = 0 n − i − 1 ( 1 − q s · 0 ) = n 1 = [ n ] ,$
and for $i ∈ { 2 , … , n }$ that $( b i , q n ) ′ ( 0 ) = 0$. Analogously, evaluating (4) at $x = 1$ we have for $i = 0$ that
$( b 0 , q n ) ′ ( 1 ) = − n 0 ∑ s = 0 n − 1 q s ∏ j = 0 ; j ≠ s n − 1 ( 1 − q j ) = − n 0 ∏ j = 1 n − 1 ( 1 − q j ) ,$
for $i ∈ { 1 , … , n − 1 }$ that
$( b i , q n ) ′ ( 1 ) = i n i ∏ s = 0 n − i − 1 ( 1 − q s ) − n i ∑ s = 0 n − i − 1 q s ∏ j = 0 ; j ≠ s n − i − 1 ( 1 − q j ) = − n i ∏ j = 1 n − i − 1 ( 1 − q j ) .$
and for $i = n$ that
$( b n , q n ) ′ ( 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
$γ ′ ( 0 ) = [ n ] ( P 1 − P 0 ) γ ′ ( 1 ) = − ∑ i = 0 n − 1 n i · ∏ s = 1 n − i − 1 ( 1 − q s ) · P i + n · P n .$
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.
Corollary 2.
The q-Bernstein basis $( b 0 , q n , … , b n , q n )$ satisfies the boundary tangent property if and only if $q = 1$, that is, if and only if it is the Bernstein basis.
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
$n i · ∏ s = 1 n − i − 1 ( 1 − q s ) = 0 for i = 0 , 1 , … , n − 2$
and
$n n − 1 = [ n ] = n .$
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$.

## 4. 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 ) i = 0 n$ of strictly positive weights, a rational q-Bernstein basis $( r 0 n , … , r n n )$ was defined as
$r i , q n ( x ) = w i b i , q n ( x ) ∑ i = 0 n w i b i , q n ( x ) , x ∈ [ 0 , 1 ] , for i = 0 , 1 , … , n ,$
and a rational q-Bézier curve as
$γ ( x ) = ∑ i = 0 n P i r i , q n ( x ) = ∑ i = 0 n P i w i b i , q n ( x ) ∑ i = 0 n w i b i , q n ( x ) , x ∈ [ 0 , 1 ] .$
where $P i ∈ R k$ ($k = 2$ or 3) are the control points of the curve.

#### 4.1. Properties of Rational q-Bézier Curves

We now summarize some basic properties of rational q-Bézier curves.
• The functions $r i , q n ( x )$ form a partition of unity:
$∑ i = 0 n r i , q n ( x ) = ∑ i = 0 n w i b i , q n ( x ) ∑ i = 0 n w i b i , q n ( x ) = 1 for all x ∈ [ 0 , 1 ] .$
• The functions $w i b i , q n ( x ) ∑ i = 0 n w i b i , q n ( x )$ are nonnegative: $w i b i , q n ( x ) ∑ i = 0 n w i b i , q n ( x ) ≥ 0$ for all $x ∈ [ 0 , 1 ]$.
• Convex hull property: A rational q-Bézier curve is always contained inside the convex hull of its control points (see Section 2 of [8]).
• Affine invariance.
• Endpoint interpolation property: This is a consequence of the identities
$r 0 , q n ( 0 ) = 1 , r i , q n ( 0 ) = 0 i = 1 , … , n , r i , q n ( 1 ) = 0 i = 0 , 1 , … , n − 1 , r n , q n ( 1 ) = 1 .$
• Invariance under barycentric combinations:
$∑ i = 0 n ( α P i + β Q i ) r i , q n ( x ) = α ∑ i = 0 n P i r i , q n ( x ) + β ∑ i = 0 n Q i r i , q n ( x ) , α + β = 1 .$
• The rational functions $( r 0 , q n , … , r n , q n )$ 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 0 , q n , … , b n , q n )$ 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.

#### 4.2. 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.
 Algorithm 3 Evaluation of a rational q-Bézier curve Require:$( P i ) 0 ≤ i ≤ n$, $( w i ) 0 ≤ i ≤ n$, $q ∈ ( 0 , 1 ]$, $x ∈ [ 0 , 1 ]$Ensure:$f 0 ( n ) ( x ) = γ ( x )$ for $i = 0$ to n do  $f i ( 0 ) ( x ) = P i$  $w i ( 0 ) ( x ) = w i$ end for for $r = 1$ to n do  for $i = 0$ to $n − r$ do   $w i ( r ) ( x ) = ( q i − q r − 1 x ) w i ( r − 1 ) ( x ) + x w i + 1 ( r − 1 ) ( x )$   $f i ( r ) ( x ) = ( q i − q r − 1 x ) w i ( r − 1 ) ( x ) f i ( r − 1 ) ( x ) + x w i + 1 ( r − 1 ) ( x ) f i + 1 ( r − 1 ) ( x ) w i ( r ) ( x )$  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 i ( r ) ( x )$ of Algorithm 3 can be expressed as
$f i ( r ) ( x ) = ∑ j = 0 r w i + j P i + j r j x j ∏ s = 0 r − j − 1 ( q i − q s x ) ∑ j = 0 r w i + j r j x j ∏ s = 0 r − j − 1 ( q i − q s x )$
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 ]$Ensure:$f 0 ( n ) ( x ) = γ ( x )$ for $i = 0$ to n do  $f ¯ i ( 0 ) ( x ) = P i$  $w ¯ i ( 0 ) ( x ) = w i$ end for for $r = 1$ to n do  for $i = 0$ to $n − r$ do   $w ¯ i ( r ) ( x ) = ( 1 − q r − i − 1 x ) w ¯ i ( r − 1 ) ( x ) + x q r − i − 1 w ¯ i + 1 ( r − 1 ) ( x )$   $f ¯ i ( r ) ( x ) = ( 1 − q r − i − 1 x ) w ¯ i ( r − 1 ) ( x ) f ¯ i ( r − 1 ) ( x ) + x q r − i − 1 w ¯ i + 1 ( r − 1 ) ( x ) f ¯ i + 1 ( r − 1 ) ( x ) w ¯ i ( r ) ( x )$  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.
Theorem 4.
The intermediate values $w i ( r ) ( x )$, $f i ( r ) ( x )$, $w ¯ i ( r ) ( x )$ and $f ¯ i ( r ) ( x )$ of Algorithms 3 and 4 satisfy
$w ¯ i ( r ) ( x ) = q − i r w i ( r ) ( x ) and f ¯ i ( r ) ( x ) = f i ( r ) ( x ) .$
Proof.
Let us prove it by induction on $r ∈ { 1 , … , n }$. For $r = 1$ we have by Algortihm 4
$w ¯ i ( 1 ) ( x ) = ( 1 − q − i x ) w ¯ i ( 0 ) ( x ) + x q − i w ¯ i + 1 ( 0 ) ( x ) = q − i ( q i − x ) w ¯ i ( 0 ) ( x ) + x w ¯ i + 1 ( 0 ) ( x ) .$
From the previous expression, by Algorithm 3 and taking into account that $w ¯ i ( 0 ) ( x ) = w i ( 0 ) ( x )$ we have
$w ¯ i ( 1 ) ( x ) = q − i w i ( 1 ) ( x ) ,$
that is, the first equation in (7) for $r = 1$. Again by Algortihm 4 for $r = 1$ we have
$f ¯ i ( 1 ) ( x ) = ( 1 − q − i x ) w ¯ i ( 0 ) ( x ) f ¯ i ( 0 ) ( x ) + x q − i w ¯ i + 1 ( 0 ) ( x ) f ¯ i + 1 ( 0 ) ( x ) w ¯ i ( 1 ) = q − i ( q i − x ) w ¯ i ( 0 ) ( x ) f ¯ i ( 0 ) ( x ) + x w ¯ i + 1 ( 0 ) ( x ) f ¯ i + 1 ( 0 ) ( x ) w ¯ i ( 1 ) .$
Substituting (8) in the previous formula, by Algorithm 3 and taking into account that $w ¯ i ( 0 ) ( x ) = w i ( 0 ) ( x )$ and $f ¯ i ( 0 ) ( x ) = f i ( 0 ) ( x )$ we deduce that
$f ¯ i ( 1 ) ( x ) = q − i ( q i − x ) w i ( 0 ) ( x ) f i ( 0 ) ( x ) + x w i + 1 ( 0 ) ( x ) f i + 1 ( 0 ) ( x ) q − i w i ( 1 ) ( x ) = ( q i − x ) w i ( 0 ) ( x ) f i ( 0 ) ( x ) + x w i + 1 ( 0 ) ( x ) f i + 1 ( 0 ) ( x ) w i ( 1 ) ( x ) = f i ( 1 ) ( x ) ,$
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
$w ¯ i ( r + 1 ) ( x ) = ( 1 − q r − i x ) w ¯ i ( r ) ( x ) + x q r − i w ¯ i + 1 ( r ) ( x ) = q − i ( q i − q r x ) w ¯ i ( r ) ( x ) + q r x w ¯ i + 1 ( r ) ( x ) .$
By the induction hypothesis we have that $w ¯ i ( r ) ( x ) = q − r i w i ( r ) ( x )$. Applying this fact in the previous formula we have
$w ¯ i ( r + 1 ) ( x ) = q − i ( q i − q r x ) q − r i w i ( r ) ( x ) + q r x q − r ( i + 1 ) w i + 1 ( r ) ( x ) = q − i ( r + 1 ) ( q i − q r x ) w i ( r ) ( x ) + x w i + 1 ( r ) ( x ) ,$
and, by Algorithm 3, we conclude
$w ¯ i ( r + 1 ) ( x ) = q − i ( r + 1 ) w i ( r + 1 ) ( x ) ,$
that is, the first formula in (7) for $r + 1$. Again by Algortihm 4 for $r + 1$ we have
$f ¯ i ( r + 1 ) ( x ) = ( 1 − q r − i x ) w ¯ i ( r ) ( x ) f ¯ i ( r ) ( x ) + x q r − i w ¯ i + 1 ( r ) ( x ) f ¯ i + 1 ( r ) ( x ) w ¯ i ( r + 1 ) = q − i ( q i − q r x ) w ¯ i ( r ) ( x ) f ¯ i ( r ) ( x ) + q r x w ¯ i + 1 ( r ) ( x ) f ¯ i + 1 ( r ) ( x ) w ¯ i ( r + 1 ) ( x ) .$
Substituting (9) in the previous formula, taking into account that $w ¯ i ( r ) ( x ) = q − i r w i ( r ) ( x )$ and $f ¯ i ( r ) ( x ) = f i ( r ) ( x )$ and by Algorithm 3 we deduce that
$f ¯ i ( r + 1 ) ( x ) = q − i ( q i − q r x ) q − i r w i ( r ) ( x ) f i ( r ) ( x ) + q r x q − ( i + 1 ) r w i + 1 ( r ) ( x ) f i + 1 ( r ) ( x ) q − i ( r + 1 ) w i ( r + 1 ) ( x ) = ( q i − q r x ) w i ( r ) ( x ) f i ( r ) ( x ) + x w i + 1 ( r ) ( x ) f i + 1 ( r ) ( x ) w i ( r + 1 ) ( x ) = f i ( r + 1 ) ( x ) ,$
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 ¯ i ( r ) ( x )$ of Algorithm 4 can be expressed as
$f ¯ i ( r ) ( x ) = ∑ j = 0 r w i + j P i + j r j x j ∏ s = 0 r − j − 1 ( q i − q s x ) ∑ j = 0 r w i + j r j x j ∏ s = 0 r − j − 1 ( q i − q s x )$
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
$γ [ 0 , c ] ( x ) = ∑ i = 0 n f 0 ( i ) ( c ) w 0 ( i ) ( c ) b i , q n ( x ) ∑ i = 0 n w 0 ( i ) ( c ) b i , q n ( x ) = ∑ i = 0 n f ¯ 0 ( i ) ( c ) w ¯ 0 ( i ) ( c ) b i , q n ( x ) ∑ i = 0 n w ¯ 0 ( i ) ( c ) b i , q n ( x ) , x ∈ [ 0 , 1 ] ,$
where quantities $w 0 ( i ) ( c )$ and $f 0 ( i ) ( c )$, and $w ¯ 0 ( i ) ( c )$ and $f ¯ 0 ( i ) ( c )$ are computed from Algorithm 3 and Algorithm 4, respectively.

#### 4.3. 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.
Proposition 2.
Given the rational q-Bézier curve $γ ( x )$ defined by (6) we have
$γ ′ ( 0 ) = [ n ] · w 1 w 0 · ( P 1 − P 0 ) , γ ′ ( 1 ) = ∑ i = 0 n − 1 n i ∏ s = 1 n − i − 1 ( 1 − q s ) w i ( P n − P i ) w n .$
Proof.
Differentiating (6) we get
$γ ′ ( x ) = ∑ i = 0 n P i w i ( b i , q n ) ′ ( x ) ∑ i = 0 n w i b i , q n ( x ) − ∑ i = 0 n P i w i b i , q n ( x ) ∑ i = 0 n w i ( b i , q n ) ′ ( x ) ∑ i = 0 n w i b i , q n ( x ) 2 .$
Evaluating the previous expression at $x = 0$ and $x = 1$ and applying Proposition 1 and that
$b 0 , q n ( 0 ) = 1 , b 1 , q n ( 0 ) = ⋯ = b n , q n ( 0 ) = 0 , b 0 , q n ( 1 ) = ⋯ = b n − 1 , q n ( 1 ) = 0 , b n , q n ( 1 ) = 1 ,$
the result follows.  □
Analogously to the nonrational case we can derive the following result.
Corollary 4.
The rational q-Bernstein basis $( b 0 , q n , … , b n , q n )$ 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$.

#### 4.4. 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
$γ ( x ) = ∑ i = 0 n + r P i r w i r b i , q n + r ( x ) ∑ i = 0 n + r w i r b i , q n + r ( x ) ,$
where, for $n ≥ 3$,
$w i k = 1 − [ n + k − i ] [ n + k ] w i − 1 k − 1 + [ n + k − i ] [ n + k ] w i k − 1 , P i k = 1 − [ n + k − i ] [ n + k ] w i − 1 k − 1 P i − 1 k − 1 + [ n + k − i ] [ n + k ] w i k − 1 P i k − 1 w i k$
for $k = 1 , 2 , … , r$, and $i = 0 , 1 , … , n + k$ with $w i 0 = w i$ and $P i 0 = P i$ for $i = 0 , 1 , … , n$.
Proof.
Denoting by
$D ( x ) : = ∑ i = 0 n w i b i , q n ( x ) and N ( x ) : = ∑ i = 0 n f i b i , q n ( x ) ,$
with $f i : = w i P i$ for $i = 0 , 1 , … , n$, we have $γ ( x ) = N ( x ) / D ( x )$. Applying Theorem 2 and Remark 1 to both $D ( x )$ and $N ( x )$ we deduce that
$D ( x ) = ∑ i = 0 n + r w i r b i , q n + r ( x ) and N ( x ) = ∑ i = 0 n + r f i r b i , q n + r ( x ) ,$
where,
$w i k = 1 − [ n + k − i ] [ n + k ] w i − 1 k − 1 + [ n + k − i ] [ n + k ] w i k − 1 , f i k = 1 − [ n + k − i ] [ n + k ] f i − 1 k − 1 + [ n + k − i ] [ n + k ] f i k − 1$
for $k = 1 , 2 , … , r$ and $i = 0 , 1 , … , n + k$, with $w i 0 = w i$ and $f i 0 = f i$ for $i = 0 , 1 , … , n$. Then, taking $P i k = f i k / w i k$ the result follows.  □
Example 1.
We have considered the rational q-Bézier curve given by (6) for $n = 4$, $q = 0.75$, weigths $( w i ) 0 ≤ i ≤ 4 = ( 1 , 15 , 30 , 15 , 1 )$ and control points $P 0 = ( 0 , 0 )$, $P 1 = ( 1 , 1.5 )$, $P 2 = ( 3.5 , 2 )$, $P 3 = ( 6 , 1.5 )$ and $P 4 = ( 7 , 0 )$. Then, applying the degree elevation method for rational q-Bézier curves given in Theorem 6 for $r = 3$ we obtain the rational q-Bézier curve given by (11) with weights $( w i 3 ) 0 ≤ i ≤ 7 = ( 0.788899 , 12.0288 , 22.8239 , 23.1543 , 17.9863 , 11.4596 , 5.43495 , 0.332817 )$ and control points $P 0 3 = ( 0 , 0 )$, $P 1 3 = ( 0.98376 , 1.47564 )$, $P 2 3 = ( 2.82167 , 1.86236 )$, $P 3 3 = ( 3.80275 , 1.85416 )$, $P 4 3 = ( 4.62368 , 1.74692 )$, $P 5 3 = ( 5.38032 , 1.58936 )$, $P 6 3 = ( 6.08145 , 1.37782 )$ and $P 7 3 = ( 7 , 0 )$. Figure 3 illustrates this particular example of the degree elevation of rational q-Bézier curves. The polygon with dashed line corresponds to the control polygon of the original curve, whereas the other polygon corresponds to the control polygon obtained after of the degree elevation process.

## 5. Rational q-Bézier Surfaces

Given a matrix of positive weights $( w i j ) 0 ≤ i ≤ m ; 0 ≤ j ≤ n$, a matrix of control points $( P i j ) 0 ≤ i ≤ m ; 0 ≤ j ≤ n$ in $R 3$ and $q 1 , q 2 ∈ ( 0 , 1 ]$, we define the rational q-Bézier surface
$F ( x , y ) = ∑ i = 0 m ∑ j = 0 n P i j w i j b i , q 1 m ( x ) b j , q 2 n ( y ) ∑ i = 0 m ∑ j = 0 n w i j b i , q 1 m ( x ) b j , q 2 n ( y ) , ( x , y ) ∈ [ 0 , 1 ] × [ 0 , 1 ] .$
Now let us consider the evaluation of q-Bézier rational surfaces. The rational q-Bézier surface in (12) can be written as
$F ( x , y ) = ∑ i = 0 m ∑ j = 0 n P i j w i j b j , q 2 n ( y ) ∑ j = 0 n w i j b j , q 2 n ( y ) ∑ j = 0 n w i j b j , q 2 n ( y ) b i , q 1 m ( x ) ∑ i = 0 m ∑ j = 0 n w i j b j , q 2 n ( y ) b i , q 1 m ( x ) .$
Taking into account the previous expression of a rational q-Bézier surface, this can be evaluated by computing the evaluation of the $2 m + 2$ q-Bézier curves, $m + 1$ rational and $m + 1$ nonrational,
$P i ( y ) = ∑ j = 0 n P i j w i j b j , q 2 n ( y ) ∑ j = 0 n w i j b j , q 2 n ( y ) and w i ( y ) = ∑ j = 0 n w i j b j , q 2 n ( y ) ,$
for $i = 0 , 1 , … , m$, and, finally, by computing the evaluation of the following rational q-Bézier curve:
$∑ i = 0 m P i ( y ) w i ( y ) b i , q m ( x ) ∑ i = 0 m w i ( y ) b i , q m ( x )$
The evaluation of all these functions can be performed by either Algorithm 3 or Algorithm 4, obtaining Algorithm 5 and Algorithm 6, respectively.
 Algorithm 5 Evaluation of a rational q-Bézier surface Require:$( w i j ) 0 ≤ i ≤ m ; 0 ≤ j ≤ n$, $( P i j ) 0 ≤ i ≤ m ; 0 ≤ j ≤ n$, $q 1 , q 2$Ensure:$F ( x , y )$ for $i = 0$ to m do  for $j = 0$ to n do   $f i j 00 = P i j$   $w i j 00 = w i j$  end for end for for $r = 1$ to n do  for $j = 0$ to $n − r$ do   $w i j 0 r = ( q j − q r − 1 y ) w i j 0 , r − 1 + y w i , j + 1 0 , r − 1$   $f i j 0 r = ( q j − q r − 1 y ) w i j 0 , r − 1 f i j 0 , r − 1 + y w i , j + 1 0 , r − 1 f i , j + 1 0 , r − 1 w i j 0 r$  end for end for for $r = 1$ to m do  for $i = 0$ to $m − r$ do   $w i 0 r n = ( q i − q r − 1 x ) w i 0 r − 1 , n + x w i + 1 , 0 r − 1 , n$   $f i 0 r n = ( q i − q r − 1 x ) w i 0 r − 1 , n f i 0 r − 1 , n + x w i + 1 , 0 r − 1 , n f i + 1 , 0 r − 1 , n w i 0 r n$  end for end for
 Algorithm 6 Evaluation of a rational q-Bézier surface Require:$( w i j ) 0 ≤ i ≤ m ; 0 ≤ j ≤ n$, $( P i j ) 0 ≤ i ≤ m ; 0 ≤ j ≤ n$, $q 1 , q 2$Ensure:$F ( x , y )$ for $i = 0$ to m do  for $j = 0$ to n do   $f ¯ i j 00 = P i j$   $w ¯ i j 00 = w i j$  end for end for for $r = 1$ to n do  for $j = 0$ to $n − r$ do   $w ¯ i j 0 r = ( q j − q r − 1 y ) w ¯ i j 0 , r − 1 + y w ¯ i , j + 1 0 , r − 1$   $f i j 0 r = ( q j − q r − 1 y ) w ¯ i j 0 , r − 1 f ¯ i j 0 , r − 1 + y w ¯ i , j + 1 0 , r − 1 f ¯ i , j + 1 0 , r − 1 w ¯ i j 0 r$  end for end for for $r = 1$ to m do  for $i = 0$ to $m − r$ do   $w ¯ i 0 r n = ( q i − q r − 1 x ) w ¯ i 0 r − 1 , n + x w ¯ i + 1 , 0 r − 1 , n$   $f ¯ i 0 r n = ( q i − q r − 1 x ) w ¯ i 0 r − 1 , n f ¯ i 0 r − 1 , n + x w ¯ i + 1 , 0 r − 1 , n f ¯ i + 1 , 0 r − 1 , n w ¯ i 0 r n$  end for end for
Taking $w i j = 1$ for all $i ∈ { 0 , 1 , … , m }$ and $j ∈ { 0 , 1 , … , n }$ in (12) a tensor product q-Bézier surface is obtained. For this particular case, Algorithms 5 and 6 are two evaluation algorithms alternative to the algorithm for the evaluation of tensor product q-Bézier surfaces proposed in [12].
As a consequence of the subdivision properties of Algorithms 3 and 4 in Theorem 5, we deduce the following subdivision properties for Algorithms 5 and 6.
Theorem 7.
Let $F ( x , y )$ a rational q-Bézier surface given by (12) and let $a , b ∈ ( 0 , 1 )$. Then the part of the surface that corresponds to $[ 0 , a ] × [ 0 , b ]$, denoted by $F [ 0 , a ] × [ 0 , b ] ( x , y )$, is given by
$F [ 0 , a ] × [ 0 , b ] ( x , y ) = ∑ i = 0 m ∑ j = 0 n f 00 i j ( a , b ) w 00 i j ( a , b ) b i , q 1 m ( x ) b j , q 2 n ( y ) ∑ i = 0 m ∑ j = 0 n w 00 i j ( a , b ) b i , q 1 m ( x ) b j , q 2 n ( y ) = ∑ i = 0 m ∑ j = 0 n f ¯ 00 i j ( a , b ) w ¯ 00 i j ( a , b ) b i , q 1 m ( x ) b j , q 2 n ( y ) ∑ i = 0 m ∑ j = 0 n w ¯ 00 i j ( a , b ) b i , q 1 m ( x ) b j , q 2 n ( y ) , ( x , y ) ∈ [ 0 , a ] × [ 0 , b ] ,$
where quantities $f 00 i j ( a , b )$ and $w 00 i j ( a , b )$, and $f ¯ 00 i j ( a , b )$ and $w ¯ 00 i j ( a , b )$ are computed from Algorithm 5 and Algorithm 6, respectively.

## 6. Conclusions

In this paper, it is shown that many properties and efficient algorithms for Bézier curves and surfaces can be extended to q-Bézier curves and surfaces, showing some differences. The existence of evaluation algorithms formed by steps in barycentric form for the rational q-Bézier curves and surfaces is also proved. Therefore, q-Bézier curves and surfaces can be very useful, sharing many nice properties with Bézier curves and surfaces and, in addition, providing greater flexibility. We also conclude that there are some limitations with respect to Bézier curves and surfaces. For instance, with the geometric boundary tangent property. Finally, we can use for rational q-Bézier curves and surfaces algorithms with many nice properties of rational Bézier curves and surfaces.

## Author Contributions

All authors contributed equally in this research paper. All authors have read and agreed to the published version of the manuscript.

## Funding

This research was partially funded by the Spanish research grant PGC2018- 096321-B-I00 (MCIU/AEI), by Gobierno de Aragón (E41-17R) and Feder 2014-2020 “Construyendo Europa desde Aragón”.

## Conflicts of Interest

The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.

## Abbreviations

The following abbreviations are used in this manuscript:
 CAGD Computer-Aided Geometric Design

## References

1. Phillips, G.M. Bernstein polynomials based on the q-integers. Ann. Numer. Math. 1997, 4, 511–518. [Google Scholar]
2. Goldman, R.; Simeonov, P. Two essential properties of (q,h)-Bernstein-Bézier curves. Appl. Numer. Math. 2015, 96, 82–93. [Google Scholar] [CrossRef]
3. Goldman, R.; Simeonov, P.; Simsek, Y. Generating functions for the q-Bernstein bases. SIAM J. Discrete Math. 2014, 28, 1009–1025. [Google Scholar] [CrossRef]
4. Carnicer, J.M.; Peña, J.M. Shape preserving representations and optimality of the Bernstein basis. Adv. Comput. Math. 1993, 1, 173–196. [Google Scholar] [CrossRef]
5. Carnicer, J.M.; Peña, J.M. Totally positive bases for shape preserving curve design and optimality of B-splines. Comput. Aided Geom. Des. 1994, 11, 633–654. [Google Scholar] [CrossRef]
6. Kac, V.; Cheung, P. Quantum Calculus, Universitext; Springer: New York, NY, USA, 2002. [Google Scholar]
7. Delgado, J.; Peña, J.M. Accurate computations with collocation matrices of q-Bernstein polynomials. SIAM J. Matrix Anal. Appl. 2015, 36, 880–893. [Google Scholar] [CrossRef]
8. Dişibüyük, Ç.; Oruç, H. A generalization of rational Bernstein-Bézier curves. BIT Numer. Math. 2007, 47, 313–323. [Google Scholar] [CrossRef]
9. Simeonov, P.; Zafiris, V.; Goldman, R. q-Blossoming A new approach to algorithms and identities for q-Bernstein bases and q-Bézier curves. J. Approx. Theory 2012, 164, 77–104. [Google Scholar] [CrossRef] [Green Version]
10. Oruç, H.; Phillips, G.M. q-Bernstein polynomials and Bézier curves. J. Comput. Appl. Math. 2003, 151, 1–12. [Google Scholar] [CrossRef] [Green Version]
11. Phillips, G.M. A de Casteljau algorithm for generalized Bernstein polynomials. BIT 1996, 36, 232–236. [Google Scholar] [CrossRef]
12. Dişibüyük, Ç.; Oruç, H. Tensor product q-Bernstein polynomials. BIT Numer. Math. 2008, 48, 689–700. [Google Scholar]
Figure 1. Boundary tangent property of q-Bernstein bases.
Figure 1. Boundary tangent property of q-Bernstein bases.
Figure 2. Boundary tangent property of rational q-Bernstein bases
Figure 2. Boundary tangent property of rational q-Bernstein bases
Figure 3. Degree elevation of rational q-Bézier curves.
Figure 3. Degree elevation of rational q-Bézier curves.

## Share and Cite

MDPI and ACS Style

Delgado, J.; Peña, J.M. Geometric Properties and Algorithms for Rational q-Bézier Curves and Surfaces. Mathematics 2020, 8, 541. https://doi.org/10.3390/math8040541

AMA Style

Delgado J, Peña JM. Geometric Properties and Algorithms for Rational q-Bézier Curves and Surfaces. Mathematics. 2020; 8(4):541. https://doi.org/10.3390/math8040541

Chicago/Turabian Style

Delgado, Jorge, and J. M. Peña. 2020. "Geometric Properties and Algorithms for Rational q-Bézier Curves and Surfaces" Mathematics 8, no. 4: 541. https://doi.org/10.3390/math8040541

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.