Necessary and Sufficient Conditions for Expressing Quadratic Rational Bézier Curves

Quadratic rational Bézier curve transformation is widely used in the field of computational geometry. In this paper, we offer several important characteristics of the quadratic rational Bézier curve. More precisely, on the basis of proving its monotonicity, the necessary and sufficient conditions for transforming a quadratic rational Bézier curve into a point, line segment, parabola, elliptic arc, circular arc, and hyperbola are proved, respectively.


INTRODUCTION
Bézier curves have wide application in computer-aided geometric design, being used to provide precisely described points along a given curve [1]. Compared to other methods, such as the French curve, Bézier-based approaches are more computationally affordable and reliable. Additionally, the advantages of the Bézier curve in geometric design include its simple but clear mathematical function [2]. For instance, it is capable of incorporating both conic sections and parametric cubic curves as special cases [3]. As such, one can deal with two different curves simultaneously using one unique computational procedure. Some preliminary studies and applications of Bézier curves can be found in Lu et al. [4], Lee [5], and Han [6].
In this paper, to better understand the basic characteristics of Bézier curves, we conduct some fundamental research. In particular, we discuss the necessary and sufficient conditions for representing six different basic shapes, including a point, line segment, parabola, elliptic arc, circular arc, and hyperbola, using Bézier curves [7,8]. These results play a fundamental role in the shape formulation and can help in facilitating any subsequent computer-based geometric design.
To begin with, we introduce the mathematical model of the quadratic rational Bézier curve [1].

Definition 1.
The quadratic rational Bézier curve is defined as follows: where and ω 0 and ω 2 are not zero values at the same time.
In the case of µ 1 = 0 and µ 2 = 0, according to Formula (1.2), we have: In other words, we have the conclusion that t is monotonically increasing [9][10][11]. Furthermore, if we apply linear transformation to Formula (1.1), it is easy to know Let ω = ω 2 1 ω 0 ω 2 and substitute µ with t in the standard form of the quadratic rational Bézier curve. To this end, we have the simplified version of the quadratic rational Bézier curve, which is expressed as follows: As can be seen from Formula (7), when t ∈ (0, 1), we have (1−t) 2 = 0, t 2 = 0, 2t(1−t) = 0, so P 0 = P A , P 1 = P A , P 2 = P A . That is, when the quadratic rational Bézier curve degenerates into a point, P 0 , P 1 , P 2 are the same point of P A . On the other hand, when three control points coincide (say, the same point P A ), we know that: As can be seen from Formula (8), when three control points P 0 , P 1 , P 2 coincide, the quadratic rational Bézier curve degenerates into a point [12,13]. Set coordinates of control points P 1 = P 0 and P 2 = P 0 3: Output coordinates of control points P 0 , P 1 , P 2 4: if the number of control points < 3 then 5: goto Step 1. 6: end if 7: Initializing the independent variable t in the standard formula of the quadratic rational Bezier curve to 0, Set t = 0 8: for t = 0; t ≤ 1; t+ = 0.00125 do 9: Calculate the standard formula of the quadratic rational Bezier Curve.
10: The quadratic rational Bézier curve degenerates into a straight line segment if and only if the control points P 0 , P 2 do not coincide, the weight factor ω = 0, or the control point P 1 is on the line segment [14][15][16].
Proof: First, we assume that one point is with two coordinates; alternatively, we have P 0 = (x 0 , y 0 ), P 1 = (x 1 , y 1 ), and P 2 = (x 2 , y 2 ). As such, for an arbitrary point p(t) = (x, y), according to Formula (6) it is easy to have: Frontiers in Physics | www.frontiersin.org On the other hand, a general form for a line function can be expressed as: y = ax + b, where a, and b is a constant [17]. Then, substituting x and y using Formula (12), we can get: If we simplify the above formula, it is easy to know: First, we assume that one point is with two coordinates; alternatively, we have P 0 = (x 0 , y 0 ), P 1 = (x 1 , y 1 ), and P 2 = (x 2 , y 2 ). As such, for an arbitrary point p(t) = (x, y), according to Formula (6) it is easy to have: Now, control points P 0 and P 2 are the first and last points of the Bézier curve. As they are all on the Bézier curve, they will also be on the straight line [18][19][20]. Alternatively, we have: Therefore, Formula (11) is further simplified: Next, Formula (14) is analyzed in the following aspects: 1. If the control point P 1 is also on the Bézier curve (or on the straight line), then y 1 − ax 1 − b = 0, and Formula (14) clearly holds. 2. If the control point P 1 is not on the Bézier curve (or not on the straight line), then y 1 − ax 1 − b = 0, and Formula (14) can be simplified as − ωt 2 + ωt = 0.
Therefore, when t ∈ [0, 1], in order to make Formula (15) hold, we have ω = 0. As such, it is proved that when the quadratic rational Bézier curve degenerates into a straight line segment, two conditions are met: (1) the weight factor ω = 0, or (2) the control point P 1 is on the line segment with the control point P 0 , P 2 as the end point. In the following, we discuss these two conditions separately.
1. According to Formula (6), when the weight factor ω = 0, we have: and (18) To simplify the calculation process, let us assume that: and Now the following formula holds: As the control points P 0 , P 2 do not coincide, where x 0 , x 2 , y 0 , y 2 are constants. We assume that 1 ,C are all constants). Accordingly, we know that Ay − Bx = C is a line segment [21]. goto Step 2. 5: end if 6: Output coordinates of control points P 0 , P 1 , P 2 7: Output line segment between control points P 0 , P 1 and P 1 , P 2 8: Initializing the independent variable t in the standard formula of the quadratic rational Bezier curve to 0, Set t = 0 9: for t = 0; t ≤ 1; t+ = 0.00125 do 10: Calculate the standard formula of the quadratic rational Bezier Curve. 11: 12: end for 13: Output Bezier Curve. 14: Clear Bezier Curve, Bezier Curve control points. goto Step 1. 15: return 2. Let the conditional control point P 1 be the end point (on the line segment with the control points P 0 and P 2 ) [22]; thus, it can be seen that: The Formula (25) can be substituted with Formula (6) to have: Then we set: Comparing Formula (26) with Formula (27), it is easy to find that In conclusion, Formula (28) is the parametric formula of the line segment. When the control point P 1 is on the line segment with the control point (P 0 , P 2 ) as the end point, Formula (26) can be written as the parametric formula of the line segment of Formula (28). As such, it is proved that it degenerates into a line segment [23,24]. goto Step 2. 5: else 6: if the number of control points = 3 then 7: Set control point P 3 on line segment with the control points P 1 and P 2 as end points 8: end if 9: end if 10: Output coordinates of control points P 0 , P 1 ,P 2 11: Output line segment between control points P 0 , P 1 and P 1 , P 2 12: Initializing the independent variable t in the standard formula of the quadratic rational Bezier curve to 0, Set t = 0 13: for t = 0; t ≤ 1; t+ = 0.00125 do 14: Calculate the standard formula of the quadratic rational Bezier Curve.
15: Proof: The equation of a circle passing through three collinear points Q i (x i , y i ), (i = 1, 2, 3), on a rectangular coordinate plane is: Given three points that are not collinear, we have: P 0 (x 0 , y 0 , 0) = (−a, 0, 0), A(x A , y A , 0), P 2 (x 2 , y 2 , 0) = (a, 0, 0). (30) The arc curve starts from point P 0 and passes through point A to point P 2 . Now, let us find another control vertex P 1 . To do so, P 0 , A, P 2 are substituted into the three-point common-circle equation 29, and we get From Formula (30) to Formula (31), we can find that x 0 = −a, y 0 = 0, x 2 = a, y 2 = 0. Furthermore, by expanding the determinant 31 in the first row, we have Among them, Frontiers in Physics | www.frontiersin.org Finally, the above formula can be simplified as follows: Because y A = 0, it is easy to know On the other hand, as x A = 0, we can add x A to have Summarizing the above formula, the coordinates of the center of the circle O are: The radius of the circle is: (38) The vertical lines of OP 0 and OP 2 are made from points P 0 and P 2 , respectively. According to the symmetry, if two vertical lines intersect with the Y axis at point P 1 , then point P 1 is the control vertex of the arc curve. That is, Accordingly, the coordinates of point P 1 are: From the definition of the Bézier Curve in Formula (1), we have: To simply Formula (41), we further introduce the Quadratic Bernstein Basis Function (B i,2 (t)), which can be expressed as follows: As such, Formula (41) can be rewritten by applying B i,2 (t) in the following format: x(t) = −aω 0 B 0,2 (t) + aω 2 B 2,2 (t) ω 0 B 0,2 (t) + ω 1 B 1,2 (t) + ω 2 B 2,2 (t) , On the other hand, note that the standard equation of curve arc circle can be estimated as Consequently, by substituting Formulas (43) into Equation (44), the following results are obtained: Note that As such, Formula (45) can be further simplified as Furthermore, according to Formula (38) and Formula (40), we can have and then, (y 2 1 + a 2 )ω 2 1 B 2 1,2 (t) − 4a 2 ω 0 ω 2 B 0,2 (t)B 2,2 (t) = 0.
Again, we consider the Quadratic Bernstein Basis Function, and then the above formula (in Formula 49) can be simplified as follows: Next, according to Formula (40), we know and t ∈ (0, 1), t 2 (1 − t) 2 = 0. It is thus easy to know According to the standard form of the quadratic rational Bézier curve (see Formula 6), we can further estimate ω 0 = ω 2 = 1, ω 1 = cos θ , and the value range of θ of the center angle of the semicircle should be 0 ≤ θ ≤ π/2 [26]. In summary, the rational quadratic Bézier expressions of arc curves passing through points P 0 , A, P 2 are as follows, Compared with the standard formula of a rational quadratic Bézier, the following results are obtained, where 0 ≤ θ ≤ π/2, 0 ≤ ω ≤ 1. Consequently, the necessary and sufficient conditions for a rational quadratic Bézier curve to represent a circular arc are expressed as follows: goto Step 2. 5: else 6: if the number of control points = 3 then 7: Set |P 0 P 1 | = |P 1 P 2 |: 8: P 2 (y) = P 0 (y) 9: end if 12: end if 13: Output coordinates of control points P 0 , P 1 ,P 2 14: Output line segment between control points P 0 , P 1 and P 1 , P 2 15: Initializing the independent variable t in the standard formula of the quadratic rational Bezier curve to 0, Set t = 0 16: for t = 0; t ≤ 1; t+ = 0.00125 do 17: Calculate the standard formula of the quadratic rational Bezier Curve.
18:  (1) is written as follows, Next, we introduce the Local Oblique Coordinate System P 1 , S, T, so that S = P 0 − P 1 , T = P 2 − P 1 . Since point P(t) is within δP 0 P 1 P 2 for arbitrary t ∈ [0, 1], P(t) can be rewritten as Comparing the coefficients from both Formula (56) and Formula (58), we know that Let k = ω 0 ω 2 /ω 2 1 , where k is the shape-invariant factor of a conic, so Formula (60) is an implicit equation of a quadratic curve in the local oblique coordinate system P 1 , S, T. The expansion of Formula (60) further indicates that: In the Cartesian coordinate system, the image of a binary quadratic equation can represent a conic curve, and all conic curves can be derived in the aforementioned way [1]. The equation has the following forms [28]: where A, B, C, D, E, F are polynomial coefficients. If the following conditions are satisfied, then Formula (62) represents an ellipse; furthermore, under the same condition, if the conic degenerates (that is, A = C, B = 0), the equation represents a circle. Additionally, if the following conditions are satisfied, Set ω = 1 or ω = −1 3: end if 4: if Quadratic Rational Bézier Curves to Represent an Elliptic Arc then 5: Set − 1 < ω < 1, and ω = 0 6: end if 7: if Quadratic Rational Bézier Curves to Represent a Hyperbola then 8: Set ω < −1 or ω > 1 9: end if 10: Input Bézier Curve control points P 0 , P 1 , P 2 11: if the number of control points < 3 then 12: goto Step 2. 13: else 14: if the number of control points = 3, and Quadratic Rational Bézier Curves to Represent an Elliptic Arc then 15: Set |P 0 P 1 | = |P 1 P 2 | 16: end if 17: end if 18: Output coordinates of control points P 0 , P 1 ,P 2 19: Output line segment between control points P 0 , P 1 and P 1 , P 2 20: Initializing the independent variable t in the standard formula of the quadratic rational Bezier curve to 0, Set t = 0 21: for t = 0; t ≤ 1; t+ = 0.00125 do 22: Calculate the standard formula of the quadratic rational Bezier Curve. 23: x = (1−t) 2 x 0 +2t(1−t)ωx 1 +t 2 x 2 (1−t) 2 +2t(1−t)ω+t 2 , y = (1−t) 2 y 0 +2t(1−t)ωy 1 +t 2 y 2 (1−t) 2 +2t(1−t)ω+t 2 24: end for 25: Output Bezier Curve. 26: Clear Bezier Curve, Bezier Curve control points. goto Step 1. 27: return then Formula (62) represents a parabola [29]. Finally, if the following conditions are satisfied, then Formula (62) represents an hyperbola. The coefficients from Formula (61) and Formula (62) can be obtained as follows: A = k, B = k − 2, C = k, D = −2k, E = −2k, F = k. As such, we can get: We then provide the discussion and judgment of Formula (66). That is, from the condition of Formula (63), if the curve is an ellipse, then in Formula (66) we have B 2 − 4AC = 1 − k < 0. Therefore, when k > 1, the curve is an ellipse. From the condition of (64), if the curve is a parabola, then B 2 − 4AC = 1 − k = 0 (again see Formula 66). Therefore, when k = 1, the curve is a parabola. From the condition of 65, if the curve is a hyperbola, then B 2 − 4AC = 1 − k > 0, so when k < 1, the curve is a hyperbola.

CONCLUSION
In this paper, we discuss the necessary and sufficient conditions for utilizing quadratic rational Bézier curves to represent different shapes, such as a point, line segment, parabola, elliptic arc, circular arc, and hyperbola. These results can be further used to facilitate other computer-aided geometric designs.

DATA AVAILABILITY STATEMENT
The raw data supporting the conclusions of this article will be made available by the authors, without undue reservation.