Appl. Math. J. Chinese Univ. 2011, 26(2): 198-212 Rational cubic/quartic Said-Ball conics HU Qian-qian 1,2 WANG Guo-jin1 Abstract. In CAGD, the Said-Ball representation for a polynomial curve has two advantages over the Bézier representation, since the degrees of Said-Ball basis are distributed in a step type. One advantage is that the recursive algorithm of Said-Ball curve for evaluating a polynomial curve runs twice as fast as the de Casteljau algorithm of Bézier curve. Another is that the operations of degree elevation and reduction for a polynomial curve in Said-Ball form are simpler and faster than in Bézier form. However, Said-Ball curve can not exactly represent conics which are usually used in aircraft and machine element design. To further extend the utilization of Said-Ball curve, this paper deduces the representation theory of rational cubic and quartic Said-Ball conics, according to the necessary and sufficient conditions for conic representation in rational low degree Bézier form and the transformation formula from Bernstein basis to Said-Ball basis. The results include the judging method for whether a rational quartic Said-Ball curve is a conic section and design method for presenting a given conic section in rational quartic Said-Ball form. Many experimental curves are given for confirming that our approaches are correct and effective. §1 Introduction In 1974, Ball [1-3] introduced a kind of rational cubic curves to be the basis of CONSURF surface lofting program, such that the traditional manual lofting technics have thoroughly been reformed. In 1989, Said [12] extended the cubic basis proposed by Ball into arbitrary odd degree basis to get a type of generalized Ball curves. Goodman and Said [8,9] proved that the generalized Ball basis is NTP (normalized totally positive) and hence it possesses the same kind of shape preserving properties as the Bernstein basis. Also its representation for a polynomial curve is much better suited to degree raising and lowering than the Bézier representation. Later Hu et al [11] suggested an extension of the generalized Ball basis to arbitrary even degree, and Received: 2009-11-11. MR Subject Classification: 16E05, 16E40, 16S37, 16W50. Keywords: Rational Said-Ball curve, Rational Bézier curve, conics. Digital Object Identifier(DOI): 10.1007/s11766-011-2417-z. Supported by the National Natural Science Foundations of China (61070065, 60933007) and the Zhejiang Provincial Natural Science Foundation of China (Y6090211). Corresponding author: wanggj@zju.edu.cn(G. J. Wang). HU Qian-qian, WANG Guo-jin. Rational cubic/quartic Said-Ball conics 199 uniformly called it Said-Ball basis. They also presented a recursive algorithm for evaluating a Said-Ball curve which is more efficient than the de Casteljau algorithm for evaluating a Bézier curve. In 2006 Delgado and Peña proved in [5] the NTP property of the family of Said-Ball basis. In a word, the research for about twenty years indicated that Said-Ball curve not only possesses the same ”shape preserving” properties as Bézier curve, but also is better than Bézier curve in evaluation of polynomial, degree elevation and reduction. To extend the utilization of Said-Ball curve, Tien et al [15] defined rational Said-Ball curve. Of course we can affirm that it is more suitable for evaluation of a conic section, degree elevation or reduction of a rational curve than the Bézier representation. However, up to now, research on rational conics focused on Bézier representation only. As we all know, conics have gained widespread applications in CAD/CAM systems. They are an important design tool in the aircraft industry and all machine manufacture; they are also used in areas such as font design [7]. There are an amount of publications on the subject of the conditions and algorithms for rational low degree Bézier representation of conics [6,10,13,16]. People have well known that for Bézier curves with all positive weights, the largest center angle of a circular arc in cubic Bézier form is not more than 4π/3 [4,16]; for quartic Bézier form, it is less than 2π [14]; and the degree to form a full circle must be at least 5 [4]. There is an analogous situation for elliptic segments, and it is important to study rational quartic Bézier representation of conics. A special representation for conics in this form which has the same weight for all control points but the middle one was presented by Fang [6]. Based on the fact that all rational Bézier conics except for degree two are all degenerate [13], Hu and Wang achieved in [10] the necessary and sufficient conditions as well as the class conditions for rational quartic Bézier representation of conics. Considering the two advantages of rational Said-Ball curve and the importance of rational cubic/quartic conics. In this paper , we study the necessary and sufficient conditions and corresponding class conditions for rational cubic and quartic Said-Ball representation of conics. The idea is based on the necessary and sufficient conditions for rational low degree Bézier representation of conics [10, 17], and the transformation formula from Bernstein basis to Said-Ball basis. According to the relationship between the areas of some triangles which are composed of the control points of rational low degree Bézier curve and rational Said-Ball curve, this paper derives all corresponding positions of the control points and all expressions of the relations between the weights, of rational quartic Said-Ball conics in five cases. Also two algorithms are provided to judge whether a rational quartic Said-Ball curve is a conic section, or design rational quartic Said-Ball representations for a given conic section. This paper is arranged as follows. In Section 2, we give some preliminary knowledge. The necessary and sufficient conditions for rational cubic Said-Ball representation of conics are given in Section 3. Based on the necessary and sufficient conditions for representing conics in rational quartic Bézier form are described in Section 4, we derive the necessary and sufficient conditions for rational quartic Said-Ball case in Section 5. And then class condition for rational quartic Said-Ball conics and two algorithms for designing and judging rational quartic Said-Ball conics are introduced in Section 6 and Section 7 respectively. Finally several numerical examples are 200 Appl. Math. J. Chinese Univ. Vol. 26, No. 2 presented to validate the effectiveness of the method in Section 8 and Section 9 conclusion are presented. §2 Definitions of rational Bézier and rational Said-Ball curves According to [7] and [15], rational cubic Bézier and rational cubic Said-Ball curves are defined by P3 3 i=0 Bi (t)σi Vi , (1) v(t) = P 3 Bi3 (t)σi i=0 P3 3 i=0 Si (t)τi Ui u(t) = P , (2) 3 3 i=0 Si (t)τi respectively. Here σi , τi (i = 0, 1, 2, 3) are the associated weights, and Vi , Ui (i = 0, 1, 2, 3) are the associated control points. For degree three, the Bernstein basis functions are (1 − t)3 , 3(1 − t)2 t, 3(1 − t)t2 , t3 , and the Said-Ball basis functions are (1 − t)2 , 2(1 − t)2 t, 2(1 − t)t2 , t2 . Also for degree four, rational Bézier and Said-Ball curves are defined by P4 4 i=0 Bi (t)ωi Ri r(t) = P , (3) 4 4 i=0 Bi (t)ωi P4 4 i=0 Si (t)wi Pi p(t) = P , (4) 4 4 i=0 Si (t)wi respectively. Here ωi , wi (i = 0, ..., 4) are the associated weights, and Ri , Pi (i = 0, ..., 4) are the associated control points. The Bernstein basis functions are (1 − t)4 , 4(1 − t)3 t, 6(1 − t)2 t2 , 4(1 − t)t3 , t4 , and the Said-Ball basis functions are (1 − t)3 , 3(1 − t)3 t, 6(1 − t)2 t2 , 3(1 − t)t3 , t3 . To preserve the convex hull property of these curves, all the weights are set as positive. §3 Rational cubic Said-Ball representation of conics By the transformation formula from Bernstein basis to Said-Ball basis [15], the rational cubic Said-Ball curve (2) is changed to the rational cubic Bézier curve (1). The corresponding weights satisfy σ0 =τ0 , 3σ1 =τ0 + 2τ1 , 3σ2 = 2τ2 + τ3 ,σ3 =τ3 , (5) and the endpoints of both curves are identical respectively, the control points V1 , V2 of curve (1) are the internal points of the line segments U0 U1 and U3 U2 with the internal ratios 2τ1 : τ0 , 2τ2 : τ3 respectively. (See Figure 1) Theorem 3.1. A rational cubic Said-Ball curve (2) is a conic section if and only if the following three conditions hold simultaneously: (a)The control polygon U0 U1 U2 U3 is self-intersecting, or non-convex but not self-intersecting; T2 T2 (c) τ1τ2τ3 = T1 (2τ2 T32+τ3 T2 ) , (b) τ0τ1τ2 = T2 (2τ1 T01+τ0 T1 ) ; where Ti (i = 0, 1, 2, 3) are the directed areas of ∆U1 U2 U3 , ∆U0 U2 U3 , ∆U0 U1 U3 and ∆U0 U1 U2 respectively (See Figure 1 ). Set U∗ as the point of intersection of lines U0 U1 and U3 U2 . Also HU Qian-qian, WANG Guo-jin. Rational cubic/quartic Said-Ball conics 201 set Ŷ,Ỹ satisfy U1 U∗ = Ŷ U0 U1 , U2 U∗ = Ỹ U3 U2 . Let τ1 τ2 ih i. η∗2 = h τ0 + (2τ1 + τ0 )Ŷ τ3 + (2τ2 + τ3 )Ỹ Then the class conditions are that curve (2) is an elliptic segment, a parabolic segment, or a hyperbolic segment respectively when η∗2 < 1, η∗2 = 1 or η∗2 > 1. U1 U2 T0 T3 T2 V1 U1 U2 T1 V2 V2 V1 S0 S3 S2 V0(U0) V3(U3) V0(U0) S1 V3(U3) Figure 1: The directed areas Si , Ti (i = 0, 1, 2, 3). Proof. According to [17], the necessary and sufficient conditions for conics in rational cubic Bézier form are as follows: S12 σ22 S22 σ12 = , = , (6) σ0 σ2 3S0 S2 σ1 σ 3 3S1 S3 and V0 V1 V2 V3 is a convex polygon without any three vertices collinear. Here Si (i = 0, 1, 2, 3) are the directed areas of the triangles ∆V1 V2 V3 , ∆V0 V2 V3 , ∆V0 V1 V3 and ∆V0 V1 V2 , respectively (See Figure 1). The key to the problem is to replace Si by Ti (i = 0, 1, 2, 3). Clearly we have S2 /T2 = 2τ1 /(2τ1 + τ0 ), S1 /T1 = S0 /S∆V1 U2 U3 = 2τ2 /(2τ2 + τ3 ). (7) (S∆V1 U2 U3 − T0 )/(T1 − T0 ) = τ0 /(2τ1 + τ0 ). Substituting the second term of (7) into the above equation, and eliminating S∆V1 U2 U3 , S0 is represented by Ti (i = 0, 1, 2, 3) as 2τ2 (2τ1 T0 + τ0 T1 ) . S0 = (2τ1 + τ0 )(2τ2 + τ3 ) S3 can be handled in a similar way, hence, 2τ1 (2τ2 T3 + τ3 T2 ) S3 = . (2τ1 + τ0 )(2τ2 + τ3 ) Substituting (5), (7) and the two above formulae into (6), and eliminating σi , Si (i = 0, 1, 2, 3), conditions (b) and (c) are proven. In addition, for rational cubic Bézier conics, the condition ’V0 V1 V2 V3 is a convex polygon without any three vertices collinear’ is equivalent to Si (i = 0, 1, 2, 3) having the same strict sign. So according to (7), we know that T1 ·T2 > 0. Multiplying (b) by τ3 and (c) by τ0 gives equivalent equations τ1 τ3 τ3 T12 T1 (2τ2 T3 + τ3 T2 ) , = = τ0 τ 2 T2 (2τ1 T0 + τ0 T1 ) τ0 T22 202 Appl. Math. J. Chinese Univ. Vol. 26, No. 2 and the second equation is equivalent to 2τ1 τ2 T0 T3 + τ0 τ2 T1 T3 + τ1 τ3 T0 T2 = 0· So we have T0 ·T3 < 0; or T0 ·T3 > 0, T0 ·T1 < 0. Without loss of generality, we assume T1 > 0, T2 > 0. Then it is either T0 < 0, T1 > 0, T2 > 0, T3 < 0 or T0 ·T3 < 0, T1 > 0, T2 > 0. In other words, the control polygon U0 U1 U2 U3 is self-intersecting, or non-convex but not self-intersecting. Then (a) is proved. Next we discuss the class conditions for rational cubic Said-Ball conics. On one hand, the class conditions for rational cubic Bézier conics are that curve (1) is an elliptic segment, a parabolic segment, or a hyperbolic segment respectively when η∗2 < 1, η∗2 = 1 or η∗2 > 1, where 1 η∗2 = . (8) V1 U∗ V2 U∗ 4 · V0 V1 · V3 V2 On the other hand, note that V1 U∗ = V1 U1 + U1 U∗ , and V1 is the internal points of the line segment U0 U1 with the internal ratio 2τ1 : τ0 , we have τ0 2τ1 V1 U∗ = U0 U1 + U1 U∗ , V0 V1 = U0 U1 . 2τ1 + τ0 2τ1 + τ0 Dividing V1 U∗ by V0 V, it hold V1 U∗ τ0 + (2τ1 + τ0 )Ŷ = . V0 V1 2τ1 By the same reasoning, we have V2 U∗ τ3 + (2τ2 + τ3 )Ỹ = . V3 V2 2τ2 Inserting the above two formulae into (8) yields the class conditions. Then the theorem is proven. Remark 3.1. Rational cubic Said-Ball curve (2) can represent only minor arcs of ellipses, so all rational cubic Said-Ball curves are obtained by degree elevation of rational quadratic form. It is different from rational cubic Bézier case. §4 Rational quartic Bézier representation of conics According to [10], the necessary and sufficient conditions for rational quartic Bézier representation of conics are presented in the five cases as follows. Case I, III: When the control points R1 , R2 , R3 are on the same side of the line R0 R4 (Figure 2(1), 2(2)) or R1 , R3 and R2 are on the both sides of the line R0 R4 respectively (Figure 2(3)), the control points and weights satisfy ω12 3 B2 B3 ω22 4 B3 D0 4 B1 D2 ω32 3 B1 B2 = , = = , = ; ω0 ω2 8 B1 D0 ω1 ω3 9 B2 D1 9 B2 D3 ω2 ω4 8 B3 D2 ω32 ω12 3 B3 D1 3 B32 D3 ω22 2 3 B1 D3 3 B12 D1 ¶, = = , = µq = = ; 2 2 ω0 ω2 2 D0 2 B1 D0 D2 ω1 ω3 ω2 ω4 2 D2 2 B3 D0 D2 B22 D1 D3 2D1 D3 − 9 B 1 B 3 D0 D2 D0 D2 HU Qian-qian, WANG Guo-jin. 203 Rational cubic/quartic Said-Ball conics Case II: When R2 is the internal point of the line segment R0 R4 , and R1 coincides with R3 (Figure 2(4)), the control points and weights satisfy Ãr ! r r D3 D1 D3 1 ω1 ω2 = + = ; , 6 D1 D3 ω3 D1 Case IV: When R0 coincides with R1 and R2 is the internal point of the line segment R1 R3 (Figure 2(5)), the control points and weights satisfy µ ¶ 2 B2 ω3 2B2 ω2 = 1+ , = ; 2 3 ω1 3 D1 ω1 D1 Case V: When R3 coincides with R4 and R2 is the internal point of the line segment R1 R3 (Figure 2(6)), the control points and weights satisfy µ ¶ ω2 2 B2 ω1 2B2 = 1+ , = . 2 3 ω3 3 D3 ω3 D3 Here Bi are the directed areas of ∆R0 Ri R4 (i = 1, 2, 3), and Dj (j = 0, ..., 3) are the directed areas of ∆R1 R3 R4 , ∆R2 R3 R4 , ∆R0 R1 R3 , and ∆R0 R1 R2 respectively (See Figure 2). R 1 R3 R2 R3 R R1 2 R4 R 0 R2 R 2 R0 R4 R1 (1) R (R ) 1 R3 R2 R2 R0 (2) R3 3 R2 (3) R4 R 1 R2 R2 R0 R2 (4) R4 R4 R0(R1) (5) R3(R4) R0 (6) Figure 2: The control polygon of a rational quartic Bézier conic section in six different forms. §5 Conics in rational quartic Said-Ball form by basis transformation By the transformation formula from Bernstein basis to Said-Ball basis [15], the rational quartic Said-Ball curve shown as (4) is changed to the rational quartic Bézier curve (3), and the corresponding control points and weights satisfy ω0 =w0 , 4ω1 =w0 + 3w1 , ω2 =w2 , 4ω3 = 3w3 + w4 , ω4 =w4 ; P3 +w4 P4 0 +3w1 P1 Ri =Pi (i= 0, 2, 4), R1 = w0 P , R3 = 3w33w . w0 +3w1 3 +w4 (9) 204 Appl. Math. J. Chinese Univ. Vol. 26, No. 2 The necessary and sufficient conditions for rational quartic Bézier representation of conics are divided into two parts: control points and weights. We discuss the two parts as follows. 5.1 Conditions about weights According to Section 4, the necessary and sufficient conditions are only related with the weights and the areas Bi , Dj (i = 1, 2, 3, j = 0, ..., 3). Since (9) provides the relationship between the weights of the curves (3) and (4), then the key to the problem is to replace Bi , Dj (i = 1, 2, 3, j = 0, ..., 3) by Ai , Cj (i = 1, 2, 3, j = 0, ..., 3). Here Ai are the directed areas of ∆P0 Pi P4 (i = 1, 2, 3), and Cj (j = 0, ..., 3) are the directed areas of ∆P1 P3 P4 , ∆P2 P3 P4 , ∆P0 P1 P3 , and ∆P0 P1 P2 respectively (See Figure 3). R2(P2) R2(P2) R2(P2) P3 P1 P 1 0 A R 1 R1 B1 R0(P0) 3 P C 3 P C2 A3 R3 R 1 D 0 D2 C1 C3 1 A2(B2) R D 1 3 P 3 D1 R3 B 3 R4(P4) R0(P0) R4(P4) R (P ) 0 0 R (P ) 4 4 Figure 3: The directed areas Ai , Bi (i = 1, 2, 3) and Ci , Di (i = 0, 1, 2, 3). By (9) we know that the control points R1 , R3 of the curve (3) are the internal points of the line segments P1 P0 and P3 P4 with internal ratios w0 : 3w1 , w4 : 3w3 respectively, and R2 = P2 . Therefore clearly we have 3w1 3w3 3w3 3w1 B1 = A1 ,B2 =A2 ,B3 = A3 ,D1 = C1 ,D3 = C3 . (10) w0 + 3w1 3w3 + w4 3w3 + w4 w0 + 3w1 Obviously the key to the problem is to find the relationship between D0 , D2 and Ai , Cj (i = 1, 2, 3, j = 0, ..., 3). According to Section 4, the necessary and sufficient conditions for rational quartic Bézier conics are related with D0 , D2 only when the control polygon is shown as in Figure 2(1)-(3). In either case, according to (9), it satisfies D0 :S∆R1 P3 P4 = 3w3 : (3w3 + w4 ). (11) In the case of Figure 2(1)-(3), according to the relation of the control points of the curves (3) and (4) shown as in Figure 3 or the left of Figure 4, there is (A3 − S∆R1 P3 P4 ) : (A3 − C0 ) = 3w1 : (w0 + 3w1 ), that is w0 A3 + 3w1 C0 . w0 + 3w1 Substituting the above formula into (11), D0 is represented by A3 and C0 as 3w3 (w0 A3 +3w1 C0 ) D0 = . (w0 + 3w1 )(3w3 + w4 ) S∆R1 P3 P4 = (12) HU Qian-qian, WANG Guo-jin. Rational cubic/quartic Said-Ball conics P1 P3 R3 P3 205 P1 R1 R1(R3) R0(P0) R4(P4) R0(P0) R2(P2) R4(P4) R2(P2) Figure 4: The control polygons of curves (1) and (2) under the case of Figure 2(3)(L) and Figure 2(4)(R). In a similar way, D2 is represented by A1 and C2 as 3w1 (3w3 C2 +w4 A1 ) D2 = . (w0 + 3w1 )(3w3 + w4 ) 5.2 (13) Conditions about control points Figure 2 illustrates the distribution types of the control points of the rational quartic Bézier conics. Since the position relation of control points of cases I and III are discussed in the above subsection, next we only need to discuss cases II, IV and V. For case II, to meet the point R1 coinciding with R3 , i.e., the lines P1 P0 and P3 P4 intersect at R1 (See the right of Figure 4), if and only if the expressions A1 w0 + 3w1 A3 3w3 + w4 = , = , B1 3w1 B1 3w3 hold. Then eliminating B1 , we have A1 w3 (w0 + 3w1 ) . (14) = A3 w1 (3w3 + w4 ) For case IV, to meet the point R0 coinciding with R1 , and R2 being the internal point of the line segment R1 R3 , according to (9), if and only if P0 coincides with P1 , and P2 is inside the triangle ∆P0 P3 P4 . And case V can be treated analogously. Finally substituting (10), (12), and (13) into the necessary and sufficient conditions for rational quartic Bézier representation of conics in Section 4 and adding (14) yields Theorem 5.1. Suppose a rational quartic Said-Ball curve is expressed as (4), and Q is the point of intersection of the two end tangent lines of the curve. Then the necessary and sufficient conditions for the curve (4) being a conic section are one of the following conditions of the control points and weights satisfying I) (1a) Pi (i = 0, 1, ..., 4) are coplanar; 206 Appl. Math. J. Chinese Univ. Vol. 26, No. 2 (1b) The positions of the three points P1 , P2 , P3 are determined by one of the following three conditions: (1b1 ) The points P1 , P3 are the internal points of division of the directed line segments P0 Q, P4 Q or on their extension lines respectively, P2 is inside the triangle ∆P0 QP4 ; (1b2 ) The points P1 , P3 are on the extension lines of the directed line segments QP0 , QP4 respectively, P2 is in the domain determined by the extension lines of the directed line segments QP0 , QP4 and the line segment P0 P4 ; (1b3 ) The points P1 , P3 are on the extension lines of the directed line segments P0 Q, P4 Q respectively, P2 is in the domain determined by the extension lines of the directed line segments QP0 , QP4 and the line segment P0 P4 ; (1c) ww0 w1 2 = 2A2 A3 A1 (w0 A3 +3w1 C0 ) ; 2A1 A2 A3 (3w3 C2 +w4 A1 ) . (1d)12w22 = w3 A3 (w0 A3 +3w1 C0 ) A2 C 1 = w1 A1 (3w3 C2 +w4 A1 ) ; A2 C 3 (1e) ww2 w3 4 = II) (2a)-(2b) Being the same as (1a)-(1b); 0 w 2 A3 (2c) w024w A3 +3w1 C0 = w0 A3 +3w1 C0 C1 3w3 C2 +w4 A1 C3 = w1 A1 (3w3 C2 +w4 A1 ) ; w 3 A3 C 3 w3 A3 (w0 A3 +3w1 C0 ) ; w 1 A1 C 1 2 w 4 A1 (2d) 3w24w = = 3 C2 +w4 A1 q A22 C1 C3 1 (2e) 24w2 = w1 w3 A1 A3 (w0 A3 +3w1 C0 )(3w3 C2 +w4 A1 ) − 2 III) (3a) Being the same as (1a); 6C1 C3 (w0 A3 +3w1 C0 )(3w3 C2 +w4 A1 ) . (3b) P2 is the internal point of division of the line segment P0 P4 , and the line segments P0 P1 and P3 P³q 4 cut cross each other;q ´ 3w3 +w4 w1 C3 w0 +3w1 w3 C1 1 (3c)w2 = 6 w0 +3w1 · w3 · C1 + 3w3 +w4 · w1 · C3 ; 3 w3 (w0 +3w1 ) 3 (w0 +3w1 ) 3 =C (3d) w C1 ; (3e) w1 (3w3 +w4 ) = w1 (3w3 +w4 )3 IV) (4a) Being the same as (1a); A1 A3 . (4b) P0 coincides with P1 , ´ and P2 is inside the triangle ∆P0 P3 P4 ; ³ 3w3 24w2 24w3 A2 2 (4c) 3w3 +w4 (w +3w )2 − 1 = A C1 ; (4d) (w0 +3w1 )3 = C1 . 0 1 V) (5a) Being the same as (1a); (5b) P3 coincides with P4 ,´and P2 is inside the triangle ∆P0 P1 P4 ; ³ 3w1 24w2 24w1 A2 2 (5c) w0 +3w1 (3w +w )2 − 1 = A C3 ; (5d) (3w +w )3 = C3 . 3 §6 4 3 4 Class conditions of rational quartic Said-Ball conics The class conditions for rational quartic Bézier conics are as follows [10]: the curve (4) is an elliptic segment, a parabolic segment, or a hyperbolic segment respectively when η 2 < 1, η 2 = 1 or η 2 > 1 respectively , where ± ± B2 B3 (4E2 · S∆R0 QR3 ) = B1 B2 (4E0 · S∆R1 QR4 ), for (I) for (II) 4ω1 ω3±, 2 η = (15) B1 B3 (S∆R1 QR4 · S∆R0 QR3 ), for (III) ω3 /ω1 , for (IV) ω1 /ω3 , for (V) HU Qian-qian, WANG Guo-jin. 207 Rational cubic/quartic Said-Ball conics Here Ei (i = 0, 1, 2, 3) are the directed areas of ∆P0 QP2 , ∆P1 QP4 , ∆P2 QP4 and ∆P0 QP3 respectively (See Figure 5). Q Q E0 E2 P1 P2(R2) P0(R0) Q E1 E3 R1 P4(R4) P0(R0) P3 R3 P4(R4) P0(R0) P4(R4) Figure 5: The directed areas of Ei (i = 0, 1, 2, 3). In order to obtain the class conditions for conics in rational quartic Said-Ball form, we need to replace the areas of ∆R1 QR4 , ∆R0 QR3 , and Bi (i = 1, 2, 3) in (15) by Ei (i = 1, 3) and Ai (i = 1, 2, 3), and the weights ωi (i = 1, 3) by wi (i = 0, 1, ..., 4). According to Figure 5, it follows that S∆R1 QR4 + B1 = A1 + E1 , S∆R0 QR3 + B3 = A3 + E3 . Substituting the first and third terms in (8) into above two equations respectively yields w0 A1 w4 A3 S∆R1 QR4 = + E1 , S∆R0 QR3 = + E3 . w0 + 3w1 3w3 + w4 Substituting (9), (10) and the above formulae into (15), we directly deduce the following Theorem 6.1. Suppose the rational quartic Said-Ball curve (4) is a conic section. Let 3w3 A2 A3 3w1 A1 A2 (I) 4E2 [3w3 E3 +w4 (A3 +E3 )] = 4E0 [w0 (A1 +E1 )+3w1 E1 ] 9w w A A 1 3 1 3 , (II) [w0 (A1 +E1 )+3w1 E1 ][3w3 E3 +w4 (A3 +E3 )] 2 η = (w0 + 3w1 )(3w3 + w4 )/4, (III) , (3w3 + w4 )/(w0 + 3w1 ), (IV) (w0 + 3w1 )/(3w3 + w4 ), (V) (16) where Ai (i = 1, 2, 3), Ei (i = 1, 3) are defined as in Figure 3 and Figure 5 respectively. Then when η 2 < 1, η 2 = 1 or η 2 > 1, the curve (4) is an elliptic segment, a parabolic segment, or a hyperbolic segment respectively. §7 Judgment and design of conics in rational quartic Said-Ball form Algorithm 7.1. (Judging whether a rational quartic Said- Ball curve is a conic section) Given a rational quartic Said-Ball curve (4) with control points Pi and weights wi (i = 0, 1, ..., 4). Step1: If Pi (i = 0, 1, ..., 4) satisfy (1a), jump to Step 2, else return ”No”. Step2: If there are at least two coincident points, then judge whether the control points and 208 Appl. Math. J. Chinese Univ. Vol. 26, No. 2 weights satisfy (4c)-(4d) or (5c)-(5d). if (4c)-(4d) hold, return ”Yes, case (IV)”, elseif (5c)-(5d) hold, return ”Yes, case (V)”, else return ”No”. If Pi (i = 0, 1, ..., 4) are different to each other: if P2 is located on the line P0 P4 , judge whether conditions (3c)-(3e) hold. if (3c)-(3e) hold, return ”Yes, case (III)”, else return ”No”. if P2 is not located on the line P0 P4 , judge whether conditions (1c)-(1e) or (2c)-(2e) hold. if (1c)-(1e) hold, return ”Yes, case (I)”, elseif (2c)-(2e) hold, return ”Yes, case (II)”, else return ”No”. Step3: If curve (4) is a conic section, calculate η 2 by Eq.(16) under five different cases. If η 2 < 1, the curve is an elliptic segment; if η 2 = 1, the curve is a parabolic segment; if η 2 > 1, the curve is a hyperbolic segment. Algorithm 7.2. (Designing a given conic section in rational quartic Said-Ball form) Given a conic section. Step1: If the two end tangent lines are not parallel, then calculate its corresponding control points Qi (i = 0, 1, 2) and weights 1, u1 , u2 in rational quadratic Said-Ball form(also in rational quadratic Bézier form), and then jump to Step 2, else jump to Step 3. Step2: Input the type of the quartic curve we need: (I)-(V). If the type is one of (II), (IV) ±√ or (V), change the weights 1, u1 , u2 to {1,u1 u2 , 1} by a linear parameter transformation ± √ t = s [s + u2 (1 − s)], and denote the new middle weight as u1 . If the type is (I), −1)Q0 +2u1 Q1 1 −1 w = 2a1 +2u , P1 = (2a12a , 3 1 +2u1 −1 1 2 Q0 +4a1 u1 u2 Q1 +u22 Q2 1+4a1 u1 u2 +u2 , P2 = w2 = , 6u2 1+4a1 u1 u2 +u22 −1 −1 1 +(2a1 u2 −1)Q2 w3 = 2u1 u2 +2a1 u2 −1 , P3 = 2u1 u2 Q−1 . 3 2u1 u2 +2a1 u2 −1 a1 > max{0, 1/2 − u1 , 1/(2u2 ) − u1 u−2 2 }, and the position of the control −2 choose −min{u1 − 1/2, u1 u2 − 1/(2u2 ), (1 + u22 )/(4u1 u2 )} < a1 < 0, and If u1 > 0, choose points is as (1b1 ); the position of the control points is as (1b3 ). 2 If u1 < 0,choose −min{u1 − 1/2, u1 u−2 2 − 1/(2u2 )} < a1 < −(1 + u2 )/(4u1 u2 ), and the position of the control points is as (1b2 ). If the type is (II), choose a1 , b1 such that the weights are positive. 4b0 (b1 +a1 u1 )−1 b1 −1)Q0 +4a1 b0 u1 Q1 , P1 = (4b04b w1 = 2 23 0 b1 −1+4a1 b0 u1 2b +2a +(4a b +b )u 2b2 Q0 +(4a1 b1 +b0 )u1 Q1 +2a21 Q2 w2 = 1 1 3 1 1 0 1 , P2 = 1 2b 2 +(4a b +b )u +2a2 1 1 0 1 1 1 4b1 u1 Q1 +(4a1 −1)Q2 4(a1 +b1 u1 )−1 , P = w3 = 3 3 4b1 u1 +4a1 −1 If u1 > 0 and b0 = 1, the position of the control points is as (2b1 ); if u1 > 0 and b0 = −1, the position of the control points is as (2b3 ); if u1 < 0, then b0 = 1, and the position of the control points is as (2b2 ). If the type is (III), then choose u1 > 1/2max{1, u2 }, the weights are 1, (2u1 − 1)/3, (1 + HU Qian-qian, WANG Guo-jin. Rational cubic/quartic Said-Ball conics 209 u22 )/(6u2 ), (2u1 /u2 − 1)/3, 1, and the control points are −Q0 + 2u1 Q1 Q0 + u22 Q2 2u1 Q1 − u2 Q2 Q0 , , , ,Q2 . 2u1 − 1 1 + u22 2u1 − u2 If the type is (IV), then choose b1 > 1/4max{1, 1/u1 }, the weights are 1, (4b1 − 1)/3, (2b21 + u1 )/3, (4b1 u1 − 1)/3, 1, and the control points are 2b2 Q0 + u1 Q1 4b1 u1 Q1 − Q2 Q0 ,Q0 , 1 2 , ,Q2 . 2b1 + u1 4b1 u1 − 1 If the type is (V), then choose a1 > 1/4max{1, 1/u1 }, the weights are 1, (4a1 u1 −1)/3, (2a21 + u1 )/3, (4a1 − 1)/3, 1, and the control points are −Q0 + 4a1 u1 Q1 u1 Q0 + 2a21 Q1 Q0 , , ,Q2 ,Q2 . 4a1 u1 − 1 u1 + 2a21 Step3: In this case, the curve is a semi-circle or semi -ellipse. Suppose the implicit function of the curve is x2 /a2 + y 2 /b2 = 1, whose two end parametric angles are θ, π + θ respectively. Input the type of the quartic curve we need: (I) or (II). For case (I), choose u2 > 0, a1 > 1/2max{1, 1/u2 }, then the weights are 1, (2a1 − 1)/3, (1 + u22 )/(6u2 ), (2a1 u2 − 1)/3, 1 and the control points are ´ ´ ³ ³ " # 3/2 1/2 a (1 − u22 ) cos θ − 4a1 u2 sin θ a (2a1 − 1) cos θ − 2u2 sin θ a cos θ ´ , ´ , 1 2 ³ , 2a11−1 ³ 1+u2 3/2 1/2 b sin θ b (1 − u22 ) sin θ + 4a1 u2 cos θ b (2a1 − 1) sin θ + 2u2 cos θ ´ " ³ # −1/2 a (2a1 u2 − 1) cos θ + 2u2 sin θ −1 ´ , −a cos θ . ³ 2a1 u2 −1 −1/2 −b sin θ b (2a1 u2 − 1) sin θ − 2u2 cos θ For case (II), choose a1 , b1 > 1/2, then the weights are 1, (4b1 − 1)/3, 2(a21 + b21 )/3, (4a1 − 1)/3, 1, and the control points are " # " ¡ " # ¢ # a cos θ a 2(b21 − a21 ) cos θ − (4a1 b1 + 1) sin θ a ((4b1 − 1) cos θ − 4a1 sin θ) 1 1 ¡ ¢ , , 4b1 −1 , 2a2 +2b2 1 1 b sin θ b ((4b1 − 1) sin θ + 4a1 cos θ) b 2(b21 − a21 ) sin θ + (4a1 b1 + 1) cos θ " # " # a ((4a1 − 1) cos θ + 4b1 sin θ) −a cos θ −1 , . 4a1 −1 b ((4a1 − 1) sin θ − 4b1 cos θ) −b sin θ §8 Numerical examples Example 8.1. Given a rational quartic Said-Ball curve, judge whether it is a conic section by Algorithm 7.1. 1) The control points: (−1, 0), (−4, −1.6), (−0.8333, −1.3333), (2, −1.6), (1, 0), the weights: 1, 0.3333, 0.5, 0.3333, 1; 2) The control points: (−1, 0), (2.3333, 1.7778), (−0.6957, −0.0696), (0.3220, 1.0847), (1, 0), the weights: 1, 0.3, 0.3833, 0.9833, 1. For case 1), since P2 is not located on the line segment P0 P4 , we need to confirm whether the control points and weights satisfy the conditions (1c)-(1e) or (2c)-(2e). By a simple calculation, 210 Appl. Math. J. Chinese Univ. P0 Vol. 26, No. 2 P4 P1 P3 P2 P1 P3 P0 P2 P4 Figure 6: A rational quartic Said-Ball representation for a conic section. the directed areas are A1 = 1.2857, A2 = 1.2706, A3 = 1, C0 = 0.1429, C1 = 0.0471, C2 = 0.4286, C3 = 0.1361. Obviously, (1c)-(1e) hold, i.e., this curve is a conic section. Further it is easy to obtain the coordinates of the point of intersection of the end-sides of the control polygon are (0.5, 1.5), and E0 = 0.1588, E1 = 0.2143, E2 = 0.0706, E3 = 0.5. By Theorem 6.1, it follows η 2 = 6, i.e., it is a hyperbolic segment. (Figure 6(1)) For case 2), since P2 is not located on the line segment P0 P4 , we need to confirm whether the control points and weights satisfy the conditions (1c)-(1e) or (2c)-(2e). By a simple calculation, the directed areas are A1 = A3 = −2.4, A2 = −2, C0 = C2 = −7.2, C1 = C3 = −3.2. Obviously, (2c)-(2e) hold, i.e., this curve is a conic section. Further it is easy to obtain the coordinates of the point of intersection of the end-sides of the control polygon are (0.5, 1.2), and E0 = E2 = 1.6, E1 = E3 = 3.6. By Theorem 6.1, it follows η 2 = 0.25, i.e., it is a hyperbolic segment. (Figure 6(2)) Example 8.2. Given a parabolic segment in rational quadratic Said-Ball form with control points (−1, 0), (−0.2, 0.8), (1, 0) and weights 1, 2, 4, represent it in rational quartic form. By Algorithm 7.2, if the curve belongs to the condition (I) and set a1 = 1, then its weights are 1, 1.6667, 2.0417, 2.6667, 1 and the control points are (−1, 0), (−0.36, 0.64), (0.1755, 0.5224), (0.85, 0.1), (1, 0) (Figure 7(1)). If the curve belongs to the condition (IV) and set b1 = 1.5, then the weights are 1, 1.6667, 1.8333, 2.6667, 1 and the control points are (−1, 0), (−1, 0), (−0.8545, 0.1455), (−0.44, 0.96), (1, 0)(Figure 7(2)). Example 8.3. Given an elliptic segment satisfying x2 /9+y 2 /16 = 1, whose two end parameter angles are π/3, 4π/3 respectively, represent its rational quartic Said-Ball form. Obviously this curve is a semi-ellipse. By Algorithm 7.2, we choose the type of this curve is (I), and set a1 = 2, u2 = 0.5. Then the weights are 1, 1, 0.4167, 0.3333, 1, and the control points are (1.5, 3.4641), (0.2753, 4.4069), (−4.9788, 6.6039), (−8.8485, 2.1928), (−1.5, 3.4641) (Figure 8(1)). If the curve belongs to the condition (II), and set a1 = 2, b1 = 3, then the HU Qian-qian, WANG Guo-jin. 211 Rational cubic/quartic Said-Ball conics P3 P1 P2 P2 P3 P0 P4 P4 P0(P1) Figure 7: A rational quartic Said-Ball representation for a conic section, (1): condition (I), (2): condition (IV). weights are 1, 3.6667, 8.6667, 2.3333, 1 and the control points are (1.5, 3.4641), (−0.3895, 4.9186), (−1.9212, 3.2554), (−5.9538, −0.0355), (−1.5, 3.4641). (Figure 8(2)) P3 P2 P2 P4 P3 P4 P1 P1 P0 P0 Figure 8: A rational quartic Said-Ball representation for a semi ellipse, (1): condition (I), (2): condition(II). §9 Concluding remarks We have presented the necessary and sufficient conditions for rational cubic and quartic SaidBall representation of conics in this paper. These conditions are divided into two categories: Said-Ball weights and control points. Further more, two algorithms are provided to design and judge rational quartic Said-Ball conics. One is to judge whether a rational quartic Said-Ball curve is a conic section; another is to present positions of the control points and values of the weights of the conic section in rational quartic Said-Ball form. These results have potential valuable application benefits to computer graphics and geometric modeling. 212 Appl. Math. J. Chinese Univ. Vol. 26, No. 2 References [1] A A Ball. CONSURF, Part 1: Introduction to the conic lofting tile, Computer-Aided Design, 1974, 6: 243-249. [2] A A Ball. CONSURF, Part 2: Description of the algorithms, Computer-Aided Design, 1975, 7: 237-242. [3] A A Ball. CONSURF, Part 3: How the program is used, Computer-Aided Design, 1977, 9: 9-12. [4] J J Chou. Higher order Bézier circles, Computer-Aided Design, 1995, 27: 303-309. [5] J Delgado, J M Peña. On the generalized Ball bases, Advances in Computational Mathematics, 2006, 24: 263-280. [6] L Fang. A rational quartic Bézier representation for conics, Computer Aided Geometric Design, 2002, 19: 297-312. [7] G Farin. Curves and surfaces for CAGD, A Practical Guide. 5th ed. San Francisco: Morgan Kaufmann, 2001. [8] T N T Goodman, H B Said. Properties of generalized Ball curves and surfaces, Computer-Aided Design, 1991, 23: 554-560. [9] T N T Goodman, H B Said. Shape preserving properties of the generalized Ball basis, Computer Aided Geometric Design, 1991, 8: 115-121. [10] Q Q Hu, G J Wang. Necessary and sufficient conditions for rational quartic representation of conic sections, Journal of Computational and Applied Mathematics, 2007, 203: 190-208. [11] S M Hu, G Z Wang, T G Jin. Properties of two types of generalized Ball curves, Computer-Aided Design, 1996, 28: 125-133. [12] H B Said. Generalized Ball curve and its recursive algorithm, ACM Transactions on Graphics, 1989, 8: 360-371. [13] J Sánchez-Reyes. Higher-order Bézier circles, Computer-Aided Design, 1997, 29: 469-472. [14] H H Shou, G J Wang. Rational quartic Bernstein basis representation of circular arcs, Journal of Applied Mathematics in Chinese Universities, 1998, 12A: 233-238. In Chinese [15] H L Tien, D Hansuebsai, H N Phien. Rational Ball curves, Int. J. Math. Educ. Sci. Technol, 1999, 30: 243-257. [16] G J Wang. Rational cubic circular arcs and their application in CAD, Computers in Industry, 1991, 16: 283-288. [17] G J Wang, G Z Wang. The rational cubic Bézier representation of conics, Computer Aided Geometric Design, 1992, 9: 447-455. 1 Department of Mathematics, Zhejiang University, Hangzhou 310027. College of Statistics and Mathematics, Zhejiang Gongshang University, Hangzhou 310018. Email: qianqianhu@hotmail.com , wanggj@zju.edu.cn. 2