American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) ISSN (Print) 2313-4410, ISSN (Online) 2313-4402 © Global Society of Scientific Research and Researchers http://asrjetsjournal.org/ Shape Preserving C2 Rational Cubic Spline Interpolation Abdurkadir Edeoa*, Genanew Gofeb, Teshome Teferac aBule Hora College of Teachers Education, Department of Mathematics, Bule Hora 133, Ethiopia bJimma University, Department of Mathematics, Jimma 378, Ethiopia c Jimma University, Department of Mathematics, Jimma 378, Ethiopia aEmail:edeoabdurkadir@gmail.com bEmail:genagof@gmail.com c Email:teshometefera596@yahoo.com Abstract In this study a piecewise rational function S ∈ C2[a, b] with cubic numerator and linear denominator involving two shape parameters has been developed to address the problem of constructing positivity preserving curve through positive data, monotonicity preserving curve through monotone data and convexity preserving curve through convex data within one mathematical model. A simple data dependent condition for a single shape parameter has been derived to preserve the positivity, monotonicity and convexity of respectively positive, monotone and convex data. The remaining shape parameter is left free for the user to modify the shape of positive, monotone and convex curves when needs arise. We extended the result of [1] to a piecewise rational cubic function S ∈ C2[a, b]. Keywords: Shape preservation; Spline interpolation; Positivity; Monotonicity; Convexity 1. Introduction Shape preservation of a given data is an important topic in the field of data visualization. In data visualization techniques researchers convert any information into graphical views. These graphical views have great importance in many fields including engineering, military, transport, advertising, medicine, education, art, etc. Data that is used for the visualization has some hidden properties such as positive or convex [2]. Curve design plays a significant role in manufacturing different products such as ship design, car modeling, and aero plane fuselages and wings [3]. ------------------------------------------------------------------------ * Corresponding author. E-mail address: edeoabdurkadir@gmail.com 110 http://asrjetsjournal.org/ American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2015) Volume 12, No 1, pp 110-122 Monthly rainfall amounts, levels of gas discharge in certain chemical reactions, progress of an irreversible process, resistance offered by an electric circuit, volume and density, etc. are some of the physical quantities which are always positive [1]. Dose–response curves and surfaces in biochemistry and pharmacology, approximations of couples and quasi-couples in statistics, empirical option pricing model in finance and approximation of potential functions in physical and chemical systems are always monotone [4]. Convexity has various applications in different disciplines including telecommunication systems designing, nonlinear programming, engineering, optimization, parameter estimation, approximation theory S. Butt, 1991 cited in [1]. A lot of research has been done on this topic. In [5] the authors used a rational cubic function in its most generalized form to preserve the shape of positive planar data. Schmidt and Heβ cited in [1] developed sufficient conditions on derivatives at the end points of an interval to assure the positivity of the cubic polynomial over the whole interval. The authors in [3] developed a C2 piecewise rational cubic spline scheme to address the problem of constructing a positivity-preserving curve through positive data. In [2] the authors introduced C2 rational cubic function with two families of free parameters to attain the C2 positive curves from positive data. In [6] the authors addressed the problem of visualizing positive data by imposing C1 continuity on rational cubic function. Fuhr and Kallay 1992 cited in [1] used a C1 monotone rational B-spline of degree one to preserve the shape of monotone data. The authors in [7] studied the problem of constructing a monotonicity preserving curve through monotone data using C2 rational cubic spline. In [8] the authors visualized monotone data by using piecewise rational cubic function. The smoothness of the interpolation is C1 continuity. Reference [9] developed an explicit representation of a C1 piecewise rational cubic spline which can produce a monotonic interpolant to a given monotone data. Brodlie and Butt 1991 cited in [1] preserved the shape of convex data by piecewise cubic interpolation. In any interval where convexity was lost, they divided the interval into two subintervals by inserting extra knots into that interval. The method that was presented was C1.A C2 rational cubic function with two families of free parameters has been introduced to attain C2 convex curves from convex data [2]. Reference [10] surveyed the shape-preserving interpolating algorithms for 2D data. Reference [11] used cubic Hermite in a parametric form to preserve the shape of data. The step lengths were used as tension parameters to preserve the shape of planar functional data. The first-order derivatives at the knots were estimated by a tridiagonal system of equations which assured C2 continuity at the knots. Reference [12] proposed a direct, inexpensive, constructive method for interpolating convex, monotone data using shape-preserving C2 cubic polynomial splines [1] discussed the three important shapes within one mathematical model. They introduced a C1 rational function with cubic numerator and cubic denominator involving four free parameters. Positivity, monotony and convexity are very important independent shape features which are found inherited in a data, under different conditions and circumstances, in one form or the other. In computer graphics environment, a user is always in need of interpolatory schemes which preserve the shape of the data under consideration under different conditions and circumstances [1]. The problem of constructing a shape preserving curve through given data points is one of the basic problems in computer graphics, computer aided geometric 111 American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2015) Volume 12, No 1, pp 110-122 design, data visualization and engineering. Classical methods, with the polynomial spline functions, show smooth and visually pleasing results but usually ignore these shape features of data and thus yield solutions exhibiting undesirable undulations or oscillations [3]. This study is a contribution towards achieving shape preserving curves for positive, monotone and convex data using one mathematical model. Several researches were focused on studying the three shape features independently using different mathematical models and methodologies. Even though, the authors in [1] tried to preserve these three shape features of data under one mathematical model and methodologies, they imposed a rational cubic interpolant ∈ 𝐶1[𝑎, 𝑏] . Thus, the purpose of this study was to construct a piecewise rational cubic spline function which can preserve the three important shapes within one mathematical model. In addition, this study is aimed to extend the result of [1] to a rational cubic interpolant 𝑆 ∈ 𝐶2[𝑎, 𝑏]. The developed scheme has the following advantageous over the other existing schemes: • It works for both equally and unequally spaced data. • The order of continuity attained is C2. • We obtained only one tridiagonal system of linear equations, for finding the values of derivative parameters. • The schemes developed in this study is smoother and visually pleasing as compared to the other schemes with order of continuity C1. • The schemes developed in this study preserves these three important shape features of data within one mathematical model. Besides shape preservation, shape control and shape design are important areas for the graphical representation of data. This paper is delimited to the area of shape preservation. The remainder of this paper has been organized as in the following order and procedures: • C2 rational cubic function with two free parameters in its description has been discussed. • We developed the conditions on a single shape parameter to preserve the positivity of a positive data. • The conditions on a single shape parameter has been derived to preserve respectively, the monotonicity and convexity of monotone and convex data. • We provided numerical examples and demonstrated the results visually using graphs. • Finally, we concluded the paper and recommended. 2. Materials and Methods Let {(𝑥𝑖 , 𝑓𝑖), 𝑖 = 1, 2, . . . ,𝑛} be a given set of data points defined over the interval [𝑎, 𝑏], where 𝑎 = 𝑥1 < 𝑥2 < · · · < 𝑥𝑛 = 𝑏. The piecewise rational cubic function 𝑆 ∈ 𝐶2[𝑎, 𝑏] involving two free parameters (𝑢𝑖 , 𝑣𝑖 > 0), over each subinterval 𝐼𝑖 = [𝑥𝑖 , 𝑥𝑖+1], 𝑖 = 1, 2, . . . ,𝑛 − 1, is defined by [13] as: 112 American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2015) Volume 12, No 1, pp 110-122 𝑆(𝑥) = ∑ (1−𝜃)3−𝑖𝜃𝑖𝐴𝑖3 𝑖=0 𝑢𝑖(1−𝜃)+ 𝑣𝑖𝜃 (1) Where ℎ𝑖 = 𝑥𝑖+1 − 𝑥𝑖 , 𝑥𝑖 ≤ 𝑥 ≤ 𝑥𝑖+1 , 𝜃 = (𝑥−𝑥𝑖) ℎ𝑖 , 𝜃 ∈ [0,1] With C2 interpolatory conditions: 𝑆(𝑥𝑖) = 𝑓𝑖 , 𝑆(𝑥𝑖+1) = 𝑓𝑖+1 , 𝑆(1)(𝑥𝑖) = 𝑑𝑖 , 𝑆(1)(𝑥𝑖+1) = 𝑑𝑖+1 , (2) 𝑆(2)(𝑥𝑖+) = 𝑆(2)(𝑥𝑖−); 𝑖 = 2, 3, . . . ,𝑛 − 1; Where 𝑆(1)(𝑥) and 𝑆(2)(𝑥) denote the first and second ordered derivatives with respect to 𝑥, the + and − subscripts denote the right and left derivatives respectively, 𝑑𝑖 denote the unknown derivative values at given knots 𝑥𝑖 that are used for the smoothness of curve. The C2 interpolating conditions produce the following unknown coefficients 𝐴𝑖 , 𝑖 = 0, 1, 2, 3 𝐴0 = 𝑢𝑖𝑓𝑖 𝐴1 = 𝑓𝑖(2𝑢𝑖 + 𝑣𝑖 ) + 𝑢𝑖ℎ𝑖𝑑𝑖 𝐴2 = 𝑓𝑖+1(𝑢𝑖 + 2𝑣𝑖 ) − 𝑣𝑖ℎ𝑖𝑑𝑖+1 𝐴3 = 𝑣𝑖𝑓𝑖+1 (3) Thus equation (1) can be reduced to a rational cubic spline: 𝑆(𝑥) = 𝑆𝑖(𝑥) = 𝑝𝑖(𝜃) 𝑞𝑖(𝜃) (4) With, 𝑝𝑖(𝜃) = 𝑢𝑖𝑓𝑖(1 − 𝜃)3 + (𝑓𝑖(2𝑢𝑖 + 𝑣𝑖 ) + 𝑢𝑖ℎ𝑖𝑑𝑖)𝜃(1 − 𝜃)2 + (𝑓𝑖+1(𝑢𝑖 + 2𝑣𝑖 ) − 𝑣𝑖ℎ𝑖𝑑𝑖+1)𝜃2(1 − 𝜃) +𝑣𝑖𝑓𝑖+1 𝜃3 𝑞𝑖(𝜃) = 𝑢𝑖(1 − 𝜃) + 𝑣𝑖𝜃 Again a C2 interpolating conditions (2) produce the following system of linear equations for the computation of derivatives parameters 𝑑𝑖(𝑖 = 2, . . . ,𝑛 − 1). 𝛼𝑖𝑑𝑖−1 + 𝛽𝑖𝑑𝑖 + 𝛾𝑖𝑑𝑖+1 = 𝜎𝑖 , for 𝑖 = 2,3, … ,𝑛 − 1 (5) With; 𝛼𝑖 = 𝑢𝑖ℎ𝑖𝑢𝑖−1 113 American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2015) Volume 12, No 1, pp 110-122 𝛽𝑖 = [𝑢𝑖ℎ𝑖(𝑣𝑖−1 + 𝑢𝑖−1) + 𝑣𝑖−1ℎ𝑖−1(𝑢𝑖 + 𝑣𝑖)] 𝛾𝑖 = 𝑣𝑖−1ℎ𝑖−1𝑣𝑖 and 𝜎𝑖 = 𝑢𝑖ℎ𝑖(𝑣𝑖−1 + 2𝑢𝑖−1)∆𝑖−1 + 𝑣𝑖−1ℎ𝑖−1(𝑢𝑖 + 2𝑣𝑖)∆𝑖 Where ∆𝑖 = (𝑓𝑖+1 − 𝑓𝑖)/ℎ𝑖 . Remark-1: If in each subinterval we use 𝑢𝑖 = 𝑣𝑖 = 1,then the rational cubic function (1) reduces to the standard cubic Hermite. Remark-2: In (5) since all 𝑢𝑖, 𝑣𝑖 , ℎ𝑖 are non-negative we see that 𝛼𝑖,𝛽𝑖, 𝛾𝑖 > 0. Moreover 𝛽𝑖 exceeds the sum of 𝛼𝑖 and 𝛾𝑖 by 𝑢𝑖𝑣𝑖−1(ℎ𝑖 + ℎ𝑖−1). ⇒ 𝛽𝑖 > 𝛼𝑖 + 𝛾𝑖 ⇒ |𝛽𝑖| > |𝛼𝑖 + 𝛾𝑖|. Therefore eq. (5) represents a diagonally dominant system of linear algebraic equation. Thus it has a unique solution for the n-2 unknown derivative parameter and can be solved either by using the LU decomposition method or any other suitable method. Remark-3: Since there are n unknown derivative values we need two more equations for the unique solution. Therefore, we have to impose the end conditions at end knots as: 𝑆(1)(𝑥1) = 𝑑1 and 𝑆(1)(𝑥𝑛) = 𝑑𝑛 (6) 3. Results and Discussion 3.1. Positivity preserving C2 rational cubic function Let {(𝑥𝑖 , 𝑓𝑖) } such that 𝑥𝑖 < 𝑥𝑖+1 for all 𝑖 = 1, 2. . .𝑛 − 1 be the set of positive data points, we need to develop the conditions on which our interpolant produces a positive curve. Thus a rational cubic function (1) is positive if both 𝑝𝑖(𝜃) and 𝑞𝑖(𝜃) are positive. Since 𝑞𝑖(𝜃) > 0 for all 𝑢𝑖 , 𝑣𝑖 > 0, we only construct the condition on a shape parameter 𝑢𝑖 for which 𝑝𝑖(𝜃) > 0. According to the result developed by Schmidt and Heβ 1988 cited in [1] 𝑝𝑖(𝜃) > 0 if (𝑝𝑖 (1)(0), 𝑝𝑖 (1)(1) ∈ 𝑅1 ∪ 𝑅2 where; 𝑅1 = �(𝑎, 𝑏): 𝑎 > −3𝑝𝑖(0) ℎ𝑖 , 𝑏 < 3𝑝𝑖(1) ℎ𝑖 � (7) 𝑅2 = � (𝑎, 𝑏): 36𝑓𝑖𝑓𝑖+1�𝑎2 + 𝑏2 + 𝑎𝑏 − 3∆𝑖(𝑎 + 𝑏) + 3∆𝑖2� + 4ℎ𝑖(𝑓𝑖+1𝑎3 − 𝑓𝑖𝑏3) −ℎ𝑖2𝑎2𝑏2 + 3(𝑓𝑖+1𝑎 − 𝑓𝑖𝑏)(2ℎ𝑖𝑎𝑏 − 3𝑓𝑖+1𝑎 + 3𝑓𝑖𝑏) > 0 � (8) 114 American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2015) Volume 12, No 1, pp 110-122 Suppose (𝑝𝑖 (1)(0), 𝑝𝑖 (1)(1)) ∈ 𝑅1 ∪ 𝑅2 then, (𝑝𝑖 (1)(0), 𝑝𝑖 (1)(1)) ∈ 𝑅1 ⇒ 𝑝𝑖 (1)(0) > −3𝑝𝑖(0) ℎ𝑖 , 𝑝𝑖 (1)(1) < 3𝑝𝑖(1) ℎ𝑖 Simplifying these inequalities gives 𝑢𝑖 > −𝑣𝑖𝑓𝑖 2𝑓𝑖+ ℎ𝑖𝑑𝑖 , 𝑢𝑖 > 𝑣𝑖(ℎ𝑖𝑑𝑖+1−2𝑓𝑖+1) 𝑓𝑖+1 The constraints on 𝑢𝑖 can also be derived from (8) but for simplicity we use the constraints obtained in (7) for positivity-preserving graphical results. Theorem-1: The C2 rational cubic spline (1) preserves positivity in each subinterval 𝐼𝑖 = [𝑥𝑖 , 𝑥𝑖+1], 𝑖 = 1, 2, . . . ,𝑛 − 1, if the shape parameters satisfy the following conditions: 𝑣𝑖 > 0, 𝑢𝑖 = 𝑤𝑖 + 𝑚𝑎𝑥 �0, −𝑣𝑖𝑓𝑖 2𝑓𝑖+ ℎ𝑖𝑑𝑖 , 𝑣𝑖(ℎ𝑖𝑑𝑖+1−2𝑓𝑖+1) 𝑓𝑖+1 � 𝑓𝑜𝑟 𝑠𝑜𝑚𝑒 𝑤𝑖 > 0 The proof follows the above derivation. Numerical example: Consider the positive data given in table−1. From Figure 1, it is clear that the cubic Hermite function has failed to preserve a positive shape of the data, whereas Figure 2 which is drawn by applying theorem−1 with 𝑣𝑖 = 0.25 preserves the shape of the positive data. Table−2 demonstrates the numerical results which are computed from the developed scheme of Figure 2. Table 1: A positive data set 𝒊 𝟏 𝟐 𝟑 𝟒 𝟓 𝟔 𝟕 𝒙𝒊 1 3 5 8 10 11 12 𝒇𝒊 2.50 1.00 0.05 0.03 0.14 0.20 0.22 Figure 1: Cubic Hermite function for positive data 0 2 4 6 8 10 12 -0.5 0 0.5 1 1.5 2 2.5 x-axis y-a xis 115 American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2015) Volume 12, No 1, pp 110-122 Figure 2: Positivity preserving C2 rational cubic function with 𝒗𝒊 = 𝟎.𝟐𝟓 Table 2: Numerical results of Figure 𝟐 𝒊 𝒅𝒊 ∆𝒊 𝒖𝒊 𝒗𝒊 𝟏 0 −0.7500 0.0010 0.25 𝟐 −0.8192 −0.4750 0.0010 0.25 𝟑 −0.1291 −0.0067 0.0445 0.25 𝟒 0.0302 0.0550 0.0010 0.25 𝟓 0.0799 0.0600 0.0010 0.25 𝟔 0.0400 0.0200 0.0010 0.25 𝟕 0 − − − 3.2. Monotonicity preserving C2 rational cubic function Let {(𝑥𝑖 , 𝑓𝑖) 𝑖 = 1, 2. . .𝑛 − 1} 𝑖 = 1, 2. . .𝑛 − 1 be the set of monotone increasing data points, such that 𝑓1 ≤ 𝑓2 ≤ . . . ≤ 𝑓𝑛 , or ∆𝑖≥ 0. Suppose 𝑑𝑖 ≥ 0 then the given piecewise rational cubic spline function (1) is monotone increasing in each subinterval 𝐼𝑖 = [𝑥𝑖 , 𝑥𝑖+1], if 𝑆(1)(𝑥) ≥ 0. Differentiating (1) ones with respect to 𝑥 we get: 𝑆(1)(𝑥) = 𝑟𝑖(𝜃) ℎ𝑖[𝑞𝑖(𝜃)]2 (9) With 𝑟𝑖(𝜃) = (1 − 𝜃)3𝐵0 + 𝜃(1 − 𝜃)2𝐵1 + 𝜃2(1 − 𝜃)𝐵2 + 𝜃3𝐵3 Where 𝐵0 = 𝑢𝑖2ℎ𝑖𝑑𝑖 𝐵1 = ℎ𝑖[𝑢𝑖2(2∆𝑖 − 𝑑𝑖) + 2𝑢𝑖𝑣𝑖(2∆𝑖 − 𝑑𝑖+1)] 0 2 4 6 8 10 12 0 0.5 1 1.5 2 2.5 x-axis y-a xis 116 American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2015) Volume 12, No 1, pp 110-122 𝐵2 = ℎ𝑖[𝑣𝑖2(2∆𝑖 − 𝑑𝑖+1) + 2𝑢𝑖𝑣𝑖(2∆𝑖 − 𝑑𝑖)] 𝐵3 = 𝑣𝑖2ℎ𝑖𝑑𝑖+1 Now 𝑆(1)(𝑥) ≥ 0 provided that 𝐵0 ,𝐵1 ,𝐵2 ,𝐵3 ≥ 0 . From our hypothesis 𝐵0 ,𝐵3 ≥ 0 is obvious. Both 𝐵1,𝐵2 are non-negative if 𝑢𝑖 ≥ 𝑣𝑖(𝑑𝑖+1−2∆𝑖) 2∆𝑖−𝑑𝑖 Theorem-2: The C2 rational cubic spline (1) preserves monotonicity in each subinterval 𝐼𝑖 = [𝑥𝑖 , 𝑥𝑖+1], 𝑖 = 1, 2, . . . ,𝑛 − 1, if the shape parameters satisfy the following conditions: 𝑣𝑖 > 0, 𝑢𝑖 = 𝑘𝑖 + 𝑚𝑎𝑥 �0, 𝑣𝑖(𝑑𝑖+1−2∆𝑖) 2∆𝑖−𝑑𝑖 � 𝑓𝑜𝑟 𝑠𝑜𝑚𝑒 𝑘𝑖 > 0 The proof follows the above derivation. Numerical example A monotone data set given in table-2 below which shows the world population from the year 1000 − 2011 in billions is borrowed from [7]. Figure 3, which is drawn by Cubic Hermite function, does not preserve the monotonicity of this data. On the other hand, Figure 4 which is drawn by monotonicity preserving C2 rational cubic function stated under theorem−2 preserves the shape of this monotone data everywhere. Table−4 demonstrates the numerical results which are computed from the developed scheme of Figure 4 Table 3: A monotone data set 𝒊 𝟏 𝟐 𝟑 𝟒 𝟓 𝟔 𝟕 𝟖 𝟗 𝟏𝟎 Years (𝒙𝒊) 1000 1250 1500 1920 1960 1980 1990 2000 2005 2011 Population (𝒇𝒊) 0.31 0.40 0.50 1.86 3.02 4.44 5.27 6.06 6.45 7.02 Figure 3: Cubic Hermite function for monotone data 1000 1200 1400 1600 1800 2000 2200 0 1 2 3 4 5 6 7 8 x-axis y-a xis 117 American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2015) Volume 12, No 1, pp 110-122 Figure 4: Monotonicity preserving C2 rational cubic function with 𝒗𝒊 = 𝟎.𝟐𝟓 Table 4: Numerical results of Figure 𝟒 𝒊 𝒅𝒊 ∆𝒊 𝒖𝒊 𝒗𝒊 𝟏 0.0000 0.0004 1.5 0.25 𝟐 0.0006 0.0004 1.5 0.25 𝟑 0.0001 0.0032 1.5 0.25 𝟒 0.0191 0.0290 1.5 0.25 𝟓 0.0451 0.0710 1.5 0.25 𝟔 0.0909 0.0830 1.5 0.25 𝟕 0.0766 0.0790 1.5 0.25 𝟖 0.0802 0.0780 1.5 0.25 𝟗 0.0801 0.0950 1.5 0.25 𝟏𝟎 0.0000 − − − 3.3. Convexity preserving C2 rational cubic function In this section, we discuss the problem of convexity preserving C2 rational cubic spline. Let {(𝑥𝑖 , 𝑓𝑖) } such that ∆𝑖< ∆𝑖+1 for all 𝑖 = 1, 2. . .𝑛 − 1 be the set of convex data points. Suppose 𝑑𝑖 < ∆𝑖 < 𝑑𝑖+1 𝑓𝑜𝑟 𝑖 = 2 , . . .𝑛 − 2 then, for the given piecewise rational cubic spline function (1) to produce a convex curve, we need 𝑆(2)(𝑥) ≥ 0.Differentiating (1) twice with respect to 𝑥 we get: 𝑆(2)(𝑥) = (1−𝜃)3𝐶0+ 𝜃(1−𝜃)2𝐶1+𝜃2(1−𝜃)𝐶2+𝜃3𝐶3 ℎ𝑖[𝑢𝑖(1−𝜃)+ 𝑣𝑖𝜃]3 (10) Where 1000 1200 1400 1600 1800 2000 2200 0 1 2 3 4 5 6 7 8 x-axis y-a xis 118 American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2015) Volume 12, No 1, pp 110-122 𝐶0 = 2𝑢𝑖3(∆𝑖 − 𝑑𝑖) + 2𝑢𝑖2𝑣𝑖(∆𝑖 − 𝑑𝑖) − 2𝑢𝑖2𝑣𝑖(𝑑𝑖+1 − ∆𝑖) 𝐶1 = 6𝑢𝑖2𝑣𝑖(∆𝑖 − 𝑑𝑖) 𝐶2 = 6𝑢𝑖𝑣𝑖2(𝑑𝑖+1 − ∆𝑖) 𝐶3 = 2𝑣𝑖3(𝑑𝑖+1 − ∆𝑖) + 2𝑢𝑖𝑣𝑖2(𝑑𝑖 − ∆𝑖) + 2𝑢𝑖𝑣𝑖2(𝑑𝑖+1 − ∆𝑖) From (10), 𝑆(2)(𝑥) ≥ 0 if 𝐶𝑖 ≥ 0 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑖 = 0,1,2,3 . Since 𝑑𝑖 < ∆𝑖< 𝑑𝑖+1 by assumption, we have 𝐶1 > 0 𝑎𝑛𝑑 𝐶2 > 0. To get 𝐶0 ≥ 0 we must have: 2𝑢𝑖3(∆𝑖 − 𝑑𝑖) ≥ 2𝑢𝑖2𝑣𝑖(𝑑𝑖+1 − ∆𝑖), This gives 𝑢𝑖 ≥ 𝑣𝑖(𝑑𝑖+1−∆𝑖) ∆𝑖−𝑑𝑖 (11) To get 𝐶3 ≥ 0 we must have: 2𝑣𝑖3(𝑑𝑖+1 − ∆𝑖) ≥ −2𝑢𝑖𝑣𝑖2(𝑑𝑖 − ∆𝑖) This gives 𝑢𝑖 ≤ 𝑣𝑖(𝑑𝑖+1−∆𝑖) ∆𝑖−𝑑𝑖 (12) From (11) and (12) we get 𝑢𝑖 = 𝑣𝑖(𝑑𝑖+1−∆𝑖) ∆𝑖−𝑑𝑖 Therefore all the above discussion yields to the following theorem. Theorem-3: The C2 rational cubic spline (1) preserves convexity in each subinterval 𝐼𝑖 = [𝑥𝑖 , 𝑥𝑖+1], 𝑖 = 1, 2, . . . ,𝑛 − 1, if the shape parameters satisfy the following conditions: 𝑣𝑖 > 0,𝑢𝑖 = 𝑚𝑖 + 𝑣𝑖(𝑑𝑖+1 − ∆𝑖) ∆𝑖 − 𝑑𝑖 𝑓𝑜𝑟 𝑠𝑜𝑚𝑒 𝑚𝑖 > 0 The proof follows the above derivation. Numerical example: Table 5 below which show a convex data set is the modification of a non-convex data set given under table 4 of [1]. The authors wrongly considered the data as if it was convex. Figure 5, which is drawn by Cubic Hermite function, does not preserve the convexity of this data. On the other hand, Figure 6 which is drawn by convexity 119 American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2015) Volume 12, No 1, pp 110-122 preserving C2 rational cubic function given under theorem−3 preserves the shape of this convex data everywhere. Table−6 demonstrates the numerical results which are computed from the developed scheme of Figure 6. Table 5: A convex data set 𝒊 𝟏 𝟐 𝟑 𝟒 𝟓 𝟔 𝟕 𝒙𝒊 −4 −3.5 −2 0 2 3.5 4 𝒇𝒊 5 3 −1.5 −1.75 −1.5 3 5 Figure 5: Cubic Hermite function for convex data Figure 6: Convexity preserving C2 rational cubic function with 𝒗𝒊 = 𝟎.𝟏 -4 -3 -2 -1 0 1 2 3 4 -2 -1 0 1 2 3 4 5 x-axis y-a xis -4 -3 -2 -1 0 1 2 3 4 -2 -1 0 1 2 3 4 5 x-axis y- ax is 120 American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2015) Volume 12, No 1, pp 110-122 Table 6: Numerical results of Figure 𝟔 𝒊 𝒅𝒊 ∆𝒊 𝒖𝒊 𝒗𝒊 𝟏 0.0000 −4.0000 0.25 0.1 𝟐 −6.4895 −3.0000 0.25 0.1 𝟑 −0.4362 −0.1250 0.25 0.1 𝟒 0.0998 0.1250 1.5 0.1 𝟓 0.3971 3.0000 0.25 0.1 𝟔 4.6556 4.0000 0.8 0.1 𝟕 0.0000 − − − 4. Conclusion In order to assure smooth visualization of shaped data, C2 rational cubic splines are constructed. A piecewise rational cubic spline function 𝑆 ∈ 𝐶2[𝑎, 𝑏] with cubic numerator and linear denominator involving two free shape parameters has been developed to address the problem of constructing positivity preserving curve through positive data, monotonicity preserving curve through monotone data and convexity preserving curve through convex data. A simple data dependent condition for a single shape parameter is derived to preserve the positivity, monotonicity and convexity of respectively positive, monotone and convex data. The remaining shape parameter is left free for the user to modify the shape of positive, monotone and convex curves when the needs arise. Each of the positivity, monotony and convexity preserving schemes has been supported with practical demonstrations on various examples of data. The developed schemes are applicable to such problems in which only data points are known. We developed a tridiagonal system of linear algebraic equations with the help of C2 interpolating conditions and this enabled us to find the unknown derivative values. Acknowledgement The authors would like to express their sincere gratitude to the anonymous referees for their exciting comments which helped them in improving this manuscript significantly. They are also thankful to the previous authors since their efforts has been used as a references in the study. Last, but not least the authors would also like to thank Jimma University for their financial and material support. References [1] M. Sarfraz, M.Z. Hussain & M. Hussain. "Shape preserving curve interpolation." International Journal of Computer Mathematics, vol.89, pp.35-53, 2012. [2] M.Z. Hussain, M. Sarfraz and T.S. Shaikh. "Shape preserving rational cubic spline for positive and convex data." Egyptian Informatics Journal,vol. 12, pp.231–236, 2011. 121 American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2015) Volume 12, No 1, pp 110-122 [3] M.Abbas, A.Abd.Majid , Hj. Awang, Md.N. and J. Md. Ali. "Positivity-preserving C2 rational cubic spline Interpolation." ScienceAsia, vol.39,pp.208–213,2012. [4] G. Beliakov. "Monotonicity Preserving Approximation Of Multivariate Scattered Data." BIT Numer. Math., vol.45, pp. 653–677,Aug.2005. [5] M.Z. Hussain and M.Sarfraz. "Positivity-preserving interpolation of positive data by rational cubics." J. Comput. Appl. Math,. vol.218, pp. 446–458,2008. [6] M.Abbas, A.Abd. Majid, and J. Md. Ali. "A Rational Spline for Preserving the Shape of Positive Data." International Journal of Computer and Electrical Engineering, vol.5,2013. [7] M.Abbas, A.Abd. Majid, and J. Md. Ali. "Monotonicity-preserving C2 rational cubic spline for monotone data." Applied Mathematics and Computation, vol.219, pp.2885–2895 ,2012. [8] M.Abbas, A. Abd. Majid, Hj. Awang, Md.N. and J.Md. Ali . "Monotonicity Preserving Interpolation using Rational Spline." Proceedings of the International multi Conference of Engineers and Computer scientists I, 2011. [9] M.Tian. "Monotonicity-Preserving Piecewise Rational Cubic Interpolation." Int. Journal of Math. Analysis, vol.5, pp. 99 – 104,2011. [10] T.N.T. Goodman. "Shape preserving interpolation by curves." In Algorithms for Approximation IV Proceedings, 2002, pp. 24–35. [11] P.Lamberti and C.Manni. "Shape-preserving C2 functional interpolation via parametric cubics." Numer. Algorithms, vol.28, pp. 229–254,2001. [12] J.C.Fiorot and J.Tabka. "Shape-Preserving C2 Cubic Polynomial Interpolating Splines." Mathematics of Computation, vol.57, Pages 291-298,1991. [13] M.Shrivastava and J.Joseph. "C2-rational cubic spline involving tension parameters." India Proc. Indian Acad. Sci. (Math. Sci.), Vol. 110, pp. 305-314, Aug.2000. 122 3. Results and Discussion 3.1. Positivity preserving C2 rational cubic function 3.2. Monotonicity preserving C2 rational cubic function 3.3. Convexity preserving C2 rational cubic function In order to assure smooth visualization of shaped data, C2 rational cubic splines are constructed. A piecewise rational cubic spline function 𝑆∈,𝐶-2.[𝑎,𝑏] with cubic numerator and linear denominator involving two free shape parameters has been dev...