Construction new rational cubic spline with application in shape preservations

Abstract: This study considers the construction a new C rational cubic spline (cubic numerator and quadratic denominator) with three parameters. Some mathematical properties of this rational function will be investigated in details. In order to use the proposed rational cubic spline for positivity preserving interpolation and constrained data that lie above any arbitrary straight line, the automatic choice of one parameter will be developed through some mathematical derivation. On each sub-interval this idea gives extra two free parameters that very useful for the user to manipulate the shape of the curve while at the same timemaintaining the shape preservations of the data. Numerical comparison with some existing schemes shows that, the proposed scheme is on par. Furthermore, for some data sets, the proposed scheme is better as well as produce more visually pleasing interpolating curve for scientific visualization.

ABOUT THE AUTHOR Samsul Ariffin Abdul Karim is a senior lecturer at Fundamental and Applied Sciences Department, Universiti Teknologi PETRONAS (UTP). He has been in the department for more than 10 years. He obtained his BAppSc., MSc and PhD in Computational Mathematics & Computer Aided Geometric Design (CAGD) from Universiti Sains Malaysia (USM). He had 15 years of experience using Mathematica and MATLAB software for teaching and research activities. His research interests include curves and surfaces designing, geometric modelling and wavelets applications in image compression and statistics. He has published more than 110 papers in Journal and Conferences as well as seven books including two research monographs as well as one edited conference volume and 10 book chapters. He was the recipient of Effective Education Delivery

PUBLIC INTEREST STATEMENT
This study considers the construction a new C 1 rational cubic spline (cubic numerator and quadratic denominator) with three parameters. The proposed rational cubic spline is implemented for positivity preserving interpolation and constrained data that lie above any arbitrary straight line. This is achieved by finding the sufficient condition that will give the automatic choice of one parameter with two free parameters for shape modification while at the same time maintaining the shape preservation. Numerical comparison with some existing schemes shows that, the proposed scheme is on par where for some data sets, the proposed scheme is better as well as produce more visually pleasing interpolating curve for scientific visualization.
The presented scheme is useful in advancing the study in image interpolation and image compression by controlling the free parameters. Furthermore, for non-technical readers, the proposed scheme also applicable for the animation industry and we believe that it is better than the common cubic Bezier and cubic spline.

Introduction
When the experiments are conducted in the laboratory, usually the scientists will obtain a lot of raw data that represents the results for that experiment. For instance, in chemical experiment, the data might be distillation curve or in biochemistry, the data maybe the movement of the respective cell inside the system. Furthermore, in any experiments, there must be exists the error or noise in the data acquisition processes. The error can be either systematic or bias error or random error. These data are subject for other data processing techniques such as data fitting and data smoothing or filtering. If the data is clean i.e. most probably no error, then interpolation is a better option to the data. But if the data consist error or noise, the approximation and smoothing or denoizing might be useful for the purposes. The common methods for data processing are linear regression, polynomial regression (or fitting), any non-polynomial fitting, cubic spline, smoothing spline, etc. Besides that, recently, the approximation or interpolation of the data does require that the curve or surface must be also maintain the geometric shape of the data. For instance, the positive data is given, then the curve should be positive everywhere. Furthermore, if the data lie above an arbitrary straight line, then the resulting interpolating curve must lie above a straight line. Both geometric properties are important in the field of scientific visualization, since if we consider the probability of some measurements, then the negativity is clearly meaningless. Furthermore, the level of oxygen in the gas discharge is also a positive data (Brodlie, Asim, & Unsworth, 2005).
We divided the literature review into two parts i.e. positivity preserving interpolation and constrained data modelling, respectively. Many researchers have investigated positivity preserving interpolation by using polynomial cubic spline, rational splines or the trigonometric spline. For instance, Abbas, Majid, M.N. Hj, and Ali (2012) have considered the constrained data interpolation for data lies above a straight line for curve and above a plane for surface interpolation. Their scheme has two free parameters that can be used to change the shape of the curve. Butt and Brodlie (1993) discussed positivity preserving interpolation by extending the main idea from Fritsch and Carlson (1980). Butt and Brodlie's scheme requires the modification of the first derivatives as well as knots insertion on some sub-intervals in which the shape violation are found. Brodlie et al. (2005) discussed the positivity preserving approximation and constrained data modelling by using Shepard's family i.e. meshfree methods. To achieve shape preserving, some optimization problem need to be solved in order to find suitable parameters. Hussain and Ali (2006) constructed positive curve by using rational cubic spline with two parameters. This idea has been extended by  for positivity preserving interpolation and constrained interpolation (both for curve and surface, respectively). The main drawback for the schemes of Hussain and Ali (2006) and  are that both schemes have no free parameters to modify the shape of the curve, since the sufficient conditions are derived on all parameters that exists in the description of their rational cubic spline. Hussain, Hussain, and Samreen (2008) implement rational quartic spline for positive and convex shape preserving interpolation. But based on our simulation, their scheme fails to preserves positivity of the data. Hussain and Sarfraz (2008) consider the positivity shape preserving by using rational cubic spline of the form cubic/cubic with two free parameters. They obtain positive interpolating curve and surface. But for some data sets, the surface tends to be flat on some region. Karim and Kong (2014) have constructed another version of rational cubic spline (cubic/quadratic) with two free parameters in each sub-interval that can be used to modify the shape of the curve. They show that their results are more visually pleasing than the scheme presented by  and . Sarfraz (2002) has studied the positivity preserving but his scheme has no free parameter to refine the final curve. Sarfraz, Hussain, and Chaudary (2005) discussed shape preservations by using cubic spline interpolation with GC 1 (first order of geometric continuity). It can be proved that their scheme does not guarantee to produce interpolating curve that lie above the given constraint line. Since for some data sets, the curve may violate the shape preservation requirement. The rational cubic spline scheme by Sarfraz, Hussain, and Nisar (2010) may produce negative curve on some interval that will destroys the positivity of the data. Wu, Zhang, and Peng (2010) proposed rational quartic spline for positivity preserving interpolation. Their scheme gives visually pleasing results but at a cost, the construction of the rational quartic spline is very complicated and not easy to used. Besides the use of cubic spline and various types of rational spline, recently there are some studies on the application of trigonometric spline (rational or non-rational) for shape preserving interpolation. For instance, Bashir and Ali (2013) constructed trigonometric spline for positive and constraint interpolation. Hussain, Hussain, and Waseem (2014), Ibraheem, Hussain, Hussain, and Bhatti (2012) and Liu, Che, and Zhu (2015) also consider various types of shape preservations by using difference sets of spline in trigonometric form. Liu et al. (2015) is the best scheme compare with Bashir and Ali (2013), Hussain et al. (2014) and Ibraheem et al. (2012). Since the introduction of cubic Ball in CAGD, there exist some applications in shape preserving interpolation. Karim (2013Karim ( , 2015aKarim ( , 2016aKarim ( , 2016bKarim ( , 2015b discussed various types of rational cubic Ball for shape preserving interpolation. The main objective of this study is to overcome the drawback in the schemes of Fritsch and Carlson (1980)-PCHIP in MATLAB, Butt and Brodlie (1993), Brodlie et al. (2005), Hussain, Sarfraz, & Shaikh, 2011), Hussain and Ali (2006) and Sarfraz et al. (2005Sarfraz et al. ( , 2010. To meet the objective, we propose new rational cubic spline (cubic/quadratic) with three parameters. We identify few advantages of the proposed schemes compare with other schemes such as: (i) The proposed scheme is free from first derivative modification for shape preservations. The schemes of Butt and Brodlie (1993) and Fritsch and Carlson (1980) do required some derivative modification.
(ii) The proposed scheme is guarantee to produce positive interpolating curve everywhere. Meanwhile in the schemes proposed by  and Hussain et al. (2011) and Sarfraz et al. (2010), positivity might not be preserved on some sub-intervals such that along the whole interval, the function value is negative i.e. lie below x-axis.
(iii) For constrained data interpolation, the proposed scheme produces interpolating curve that lie above a straight line, but the scheme of Sarfraz et al. (2005) give some interpolating curve that lies below a straight line. Comparing with Karim and Kong (2014), the proposed scheme gives more visually pleasing interpolating curve as well as the curve is very closed to the constraint line.
This paper is organized as follows. Section 2 presents the methodology of the proposed study. This includes the construction of another version of rational spline with quadratic denominators where in each sub-interval; it has three parameters, derivative estimation and geometric properties of the rational interpolant. Shape control analysis will be shown with numerical examples. Section 3 describes about the shape preserving interpolation applications. We consider positivity preserving and constrained data modelling. The automated choice of one parameter that will ensure the rational interpolant satisfies shape preservations properties will be derived with two parameters to refine the curve shape. Section 4 presents the numerical and graphical results, including comparison with established schemes. Finally, Section 5 concludes the paper and presents future recommendation studies by using the proposed scheme.

Methodology of the study
We begin with the construction of new rational spline S x ð Þ (cubic numerator and quadratic denominator) with three parameters α i ; β i , and γ i , for i ¼ 0; 1; . . . ; n À 1. This section is divided into few subsection as follows: the construction of new rational cubic spline, derivative estimation and the geometric properties of the proposed rational interpolant.

Rational spline construction
Given data g where x 0 < x 1 < Á Á Á < x n and the first derivatives . . . ; n À 1, the rational cubic spline with three parameters α i ; β i , and γ i , for i ¼ 0; 1; . . . ; n À 1 is defined by The common requirement for the parametric continuity is C 1 or C 2 continuous. Throughout this study, we only consider the construction of rational cubic spline with C 1 continuity. This condition can be described as follows (Fritsch & Carlson, 1980;Sarfraz, 2002): By applying Condition (2) to Equation (1), we obtain the unknown A i ; B i ; C i and E i for i ¼ 0; 1; . . . ; n À 1 as follows: Therefore, the rational cubic spline in (1) can be written as

Derivative estimation
There exist various methods that can be used to estimate the first derivative d i ; i ¼ 0; 1; . . . ; n such as geometric mean method (GMM), harmonic mean method (HMM) and arithmetic mean method (AMM). Since AMM is simple and easy to use as well as suitable for all types of data sets (Hussain & Sarfraz, 2008), throughout this study we utilized AMM. Its formulation is given below: For i ¼ 1; 2; 3; . . . ; n À 1, d i is calculated as follows (Sarfraz, 2002): Meanwhile, at i ¼ 0 and i ¼ n, the derivative value of d 0 and d n are given as Furthermore, if the data are equally space, then for i ¼ 1; 2; 3; . . . ; n À 1, the first derivatives are given as

Geometric properties of the rational spline
The geometric properties of the proposed rational cubic spline defined by (3) are investigated in this section. The main focus is on the shape control analysis of the rational spline. This shape control in important in order for us to determine the condition on α i ; β i , and γ i , for i ¼ 0; 1; . . . ; n À 1. Furthermore, we will see various types of interpolating curves corresponding with various value of parameters α i ; β i , and γ i . There are three geometric properties that can be observed: (3) is reduce to cubic Hermite spline polynomial that can be expressed as which can be simplified to • After some derivation and simplification, the piecewise rational cubic spline S i x ð Þ defined by (3) can be written as From (8), when γ i ! 1, the rational cubic interpolant S i x ð Þ reduce to a straight line on each subinterval x i ; x iþ1 ½ ; for i ¼ 0; 1; :::; n À 1. This is also applicable when α i ; β i ! 0. Thus the following limit is obtained: • When α i < 0, or β i < 0 or γ i À3, the rational cubic spline interpolant defined by (3) turn to be the standard rational function with vertical asymptotes or poles on sub-interval x i ; x iþ1 ½ ; i ¼ 0; 1; . . . ; n À 1.
A positive data set taken from Wu et al. (2010) is shown in Table 1. The data sets show the velocity of the wind that has the positive values. Figure 1 shows the examples of shape control properties. Figure 1(a) shows the cubic Hermite when α i ¼ β i ¼ γ i ¼ 1. Figure 1(b) shows the effect when we increases the value of one parameter i.e. γ i while α i ¼ β i ¼ 1 : γ i ¼ 1 (solid), γ i ¼ 10 (dashed) and (grey). Clearly as γ i ! 1, the rational cubic spline approaching a straight line on each sub-interval. Figure 1(c) also shows the effect that the rational cubic spline reduces to a straight line when both α i ; β i ! 0. Figure 1(d) shows the effect Figure 1(e) shows that when both α i ; β i ! 1, the rational spline does not reduce to a straight line. Figure 1(f) shows that the interpolating curve have poles when α i ¼ À1; β i ¼ γ i ¼ 1. This is also true when β i < 0 or γ i À3. This is the main reason that, the parameters are chosen such that α i ; β i > 0, and γ i ! 0 for i ¼ 0; 1; . . . ; n À 1. Finally Figure 1(g) shows the effect when α i ¼ β i ¼ 1 and γ i ¼ 5. From this graph, the positivity of the data set is preserved and it is visually pleasing.

Shape preservations
In this section, we derive the sufficient condition for the positivity of the proposed rational cubic spline on one parameter. We begin with positivity preserving interpolation and the idea for positivity preserving is extended to constrained data interpolation for data that lie above an arbitrary straight line.

Positivity preserving
In order to avoid divided by zero later, we assume that, the given data is strictly positive  The main objective is to find the condition on γ i > 0, i ¼ 0; 1; . . . ; n À 1 that will ensure the rational spline defined by (3) is positive everywhere. Mathematically, this statement can be expressed as We can preserve the positivity by manipulating the value of the parameters α i ; β i > 0, and γ i ! 0, for i ¼ 0; 1; 2; . . . ; n À 1 (see Figure 1(g), the positivity of the data in Table 1 is preserved when α i ¼ β i ¼ 1 and γ i ¼ 5, etc.). But this approach is not practical and really time consuming to find suitable value for all parameters. Our aim is to find the automated choice on one parameter γ i > 0, i ¼ 0; 1; . . . ; n À 1 that will produce positive rational cubic interpolant that resulting the positive interpolating curve on the whole given domain (by satisfying Condition (10b)). Meanwhile, α i ; β i > 0 are free parameters for shape modification. For α i ; β i > 0, and γ i ! 0 for i ¼ 0; 1; . . . ; n À 1, the denominator Q i θ ð Þ is positive i.e. Q i θ ð Þ > 0. Therefore, the sufficient condition for the positivity of the rational interpolant defined by (3) can be derived by considering only the numerator i.e. the cubic polynomial P i θ ð Þ; i ¼ 0; 1; . . . ; n À 1 such that P i θ ð Þ > 0. Therefore, the rational cubic spline S i x ð Þ > 0; if the cubic polynomial P i θ ð Þ > 0 for i ¼ 0; 1; 2; . . . ; n À 1. The following results are obtained by Schmidt and Hess (1988). The cubic spline P i θ ð Þ; i ¼ 0; 1; . . . ; n À 1 is positive if Note: Here a ¼ P 0 i 0 ð Þ and b ¼ P 0 i 1 ð Þ, respectively.
The following theorem gives the sufficient conditions for the positivity of rational spline.
Firstly, we derive the first derivative of P 0 i θ ð Þ which can be written as The sufficient condition of the positivity is derived by using (12): and Both conditions can be further simplified to By using (17) and (18), S i x ð Þ > 0; i ¼ 0; 1; 2; . . . ; n À 1 if parameter γ i > 0, i ¼ 0; 1; . . . ; n À 1 satisfy the following positivity condition: This condition can be written as such that 0 < ε i 0:5.
The following is an algorithm for computer implementation.
Algorithm 1: positivity preserving interpolation Input: Data points, first derivative and the parameters α i ; β i > 0 and ε i > 0.
• Calculate the parameter values, γ i > 0 by using the sufficient condition (19).
• Repeat by choosing different value of α i ; β i > 0 and ε i > 0.

Constrained data interpolation
The constrained data interpolation for data that lie on a same side as the constraint line is constructed by extending the positivity scheme discussed in the previous section. In this study, we only consider the data that lie above straight line. The problem statement can be read as follows: The rational spline interpolation S i x ð Þ defined in (3) lie above a straight line 1 À θ Here, we adopted the notation a i ¼ mx i þ c; i ¼ 0; 1; . . . ; n and b i ¼ mx iþ1 þ c; i ¼ 0; 1; . . . ; n À 1.
which can be written Simple simplification to (23) leads to The rational spline interpolant on S i x ð Þ in (3) lie above a straight line on x i ; x iþ1 ½ ; i ¼ 0; 1; . . . ; n À 1, if the parameters γ i satisfies the following condition: with α i ; β i > 0.

Proof.
Since α i ; β i > 0, the curve lie above a straight line if U i θ ð Þ > 0. The necessary conditions aref i À a i > 0 and f iþ1 À b i > 0, respectively. Thus the sufficient condition can be derived from inequalities K 1 > 0 and K 2 > 0, such that: and From (24) and (25) we obtain and For i ¼ 0; 1; . . . ; n À 1, both conditions (26) and (27) can be combined to produce the automatic choice of the parameter γ i > 0, This completes the proof.
Remark 2: To generate the curve lie above straight line, Condition (28) can be rewritten as where 0 < η i 0:5.
Below is algorithm that can be used to generate the interpolating curve that lies above arbitrary straight line where parameter γ i ; is calculated from (29) with suitable positive values of α i ; β i and η i .

Algorithm 2: constrained data interpolation
Input: Data points, first derivative and parameters α i ; β i > 0 and ε i > 0 and the constraint line y ¼ mx þ c:
• Calculate the parameter values, γ i > 0 by using the sufficient condition (29).
• Repeat by choosing the different value of α i ; β i > 0 and η i > 0.

Results and discussion
The numerical results for positivity preserving interpolation and the constrained data interpolation above arbitrary straight line will be presented. For positivity preserving, three data sets were chosen from Butt and Brodlie (1993), Sarfraz et al. (2010) and Hussain and Ali (2006), respectively. Meanwhile for constrained data interpolation, three data sets also were used. All numerical experiments are done by using Mathematica Version 11 and MATLAB Version 2015 on Intel(R) Core (TM) i5-3470 CPU @3.20GHz.
Example 3. Table 4 is obtained from Hussain and Ali (2006) which demonstrate the depreciation of the valuation of the market price of computers which are installed at City Computer Center. The x-coordinate corresponds to the time in years and y-coordinate corresponds to the computers price in 10000. Figure 4(a) shows the cubic Hermite spline interpolation. Figure 4(b) shows the positivity preservation by the scheme of Hussain and Ali (2006). Figure 4(c) shows the positivity preserving interpolation by using PCHIP scheme. Figure 4(d) shows the positivity interpolation by using the proposed scheme when α i ¼ β i ¼ 1 for i ¼ 0; 1; . . . ; 7 with γ i ¼ 0:1; 0:1; 5:167; 0:1; 0:1; 0:1; 0:1 f g . Meanwhile Figure 4(e) shows the positive interpolating curve for α i ¼ 2; β i ¼ 1 for i ¼ 0; 1; . . . ; 6 and    (19). The proposed scheme gives more visually pleasing curves than the interpolating curve produced by the  scheme of Hussain and Ali (2006) and PCHIP. The two shape parameters α i ; β i are used to refine the positive curve.  Example 4. Table 5 demonstrates the data lies above a straight liney ¼ x þ 2 from . Figure 5(a) shows the cubic Hermite spline interpolation. Clearly cubic Hermite is unable to produce interpolating curve lie above straight line. Figure 5(b) shows the constrained data interpolation by using the method of . Figure 5(c) shows that the scheme of Sarfraz et al. (2005) fails to produce the interpolating curve with shape preservation. Figure 5(d) shows the interpolating curve by using Karim and Kong (2014) scheme. Figure 5(e) -5 (g) shows the constrained data interpolation using the proposed scheme with α i ¼ β i ¼ 1, α i ¼ 1; β i ¼ 2 and α i ¼ 1; β i ¼ 4 for all i ¼ 0; 1; . . . ; 6. The parameter γ i is calculated from Condition (29)   (g), respectively. Figure 5(g) indicates that the bigger the value of β i will give loose curve and very visually pleasing. Compared to Karim and Kong (2014), the proposed scheme gives more visually pleasing results as well as the interpolating curve is very close to the constraint line while at the same time maintaining shape preservation. Therefore, by having two free parameters, α i ; β i , the interpolating curves can be changed interactively.
Figure 6(a) shows that the cubic spline interpolation cannot produce the interpolating curve lie above a straight line. Figure 6(b) until 6(d) shows the constrained data interpolation with the proposed scheme by using Theorem 2. The proposed scheme with α i ¼ β i ¼ 0:5 give more visually pleasing result compare with the other interpolating curves.
Example 6. The data in Table 7 lie above two straight lines y ¼ x.
Figure 7(a) shows that the cubic spline interpolation with α i ¼ β i ¼ γ i ¼ 1 is not shape preserving interpolation to the constraint line. Figure 7(b) until 7(d) shows that the interpolating curve lies above the given constraint line by applying Theorem 2.  Figure 6. Interpolating curves for data in Table 6.
From all numerical and graphical results, we can conclude that, the proposed scheme is on par with some existing schemes. Furthermore, for some data sets, we show that various existing schemes are not shape preserving. For instance, for positive data in Table 2, the schemes proposed by Hussain et al. (2011) and  fail to preserve the positivity on the sub-interval (Hussain et al., 2011, 28). Sarfraz et al.'s (2005) scheme also fails to produce the interpolating curve lie above a constraint line. Furthermore, for data set in Table 6, the proposed scheme gives more visually pleasing result compared with the scheme of Karim and Kong (2014) and PCHIP. With all this examples and justification, the proposed scheme is suitable for positivity preserving and constrained data interpolation since the two free parameters α i ; β i , can be utilized to produce visually pleasing results while at the same time achieve the shape preservations.

Conclusion and future recommendation
To overcome the drawback in some shape preserving schemes, in this study a new type of rational cubic spline (cubic numerator and quadratic denominator) is constructed. It has three parameters α i ; β i , and γ i , for all i ¼ 0; 1; . . . ; n À 1. This new rational spline (cubic/quadratic) is used for positivity preserving and constrained interpolation for data lie above arbitrary straight line. To achieve the shape Table 7. A data above straight line preserving, we derive an automatic choice on one parameter γ i , for i ¼ 0; 1; . . . ; n À 1 meanwhile the other two parameters α i and β i can be used to modify the shape of the interpolating curve. Theorems 1 and 2 are guaranteed sufficient to produce the positive interpolating curve and constrained interpolating curve lie above arbitrary straight line. Work on monotonicity and convexity shape preserving interpolation by using the proposed scheme is underway including surface interpolation