#### Abstract

We present the smooth and visually pleasant display of 2D data when it is convex, which is contribution towards the improvements over existing methods. This improvement can be used to get the more accurate results. An attempt has been made in order to develop the local convexity-preserving interpolant for convex data using rational cubic spline. It involves three families of shape parameters in its representation. Data dependent sufficient constraints are imposed on single shape parameter to conserve the inherited shape feature of data. Remaining two of these shape parameters are used for the modification of convex curve to get a visually pleasing curve according to industrial demand. The scheme is tested through several numerical examples, showing that the scheme is local, computationally economical, and visually pleasing.

#### 1. Introduction

In computer graphics, a designer in industries needs to generate splines which can interpolate the data points in such a way that they conserve the inherited shape characteristics (positivity, monotonicity, and convexity) of data. Among the properties that the spline for curves and surfaces need to satisfy, smoothness and shape preservation of given data are mostly needed by all the designers. Convexity is a substantial shape characteristic of the data. The significance of the convexity-preserving interpolation problems in industry cannot be denied. A number of examples can be quoted in this regard, like the modelling of cars in automobile industry, aeroplane, and ship design. A crumpled curve is an unwanted characteristic. Human aesthetic sense demands convexity-preserving nice and smooth curves without wiggles [1]. Convexity should also be upheld in many applications including nonlinear programming problems occurring in engineering, telecommunication system design, approximation of functions, parameter estimation, and optimal control. The traditional cubic spline schemes have been used for quite a long time to deal with the problems of constructing smooth curves that passes through given data points. However, these splines sometimes fail to conserve the inherited shape characteristics because of unwanted oscillations that are not suitable for design purpose.

Some work [1–11, 13] on shape preservation has been published in recent years. Abbas et al. [2, 4, 5] discussed the problem of local convexity-preserving data visualization using piecewise rational cubic and bicubic function with three shape parameters. The authors derived the data dependent conditions for single shape parameter to get the convexity preserving curve and remaining shape parameters were used for the modification of convex curve to obtain a visually pleasing curve. Brodlie and Butt [6] solved the problem of shape preserving of convex data by using the cubic Hermite interpolation. The authors inserted one or two extra knots in the interval where the shape of data was not conserved. Costantini [7] solved the shape preserving of boundary valued problems using polynomial spline interpolation with arbitrary constraints. Duan et al. [12] developed rational interpolation based on function values and also discussed constrained control of the interpolating curves. They obtained conditions on function values for constraining the interpolating curves to lie above, below, or between the given straight lines. The authors assumed suitable values of parameters to obtain continuous curve and the method works for only equally spaced data.

Fiorot and Tabka [8] used cubic polynomial spline to conserve the shape of convex or monotone data. The authors obtained the values of derivative parameters by solving three systems of linear equations. Hussain et al. [9] addressed the problem of shape preserving rational cubic spline for positive and convex data. Simple data dependent constraints were derived for free parameters used in the description of rational cubic function to achieve the desired shape of the data. The scheme provided a limited freedom to designer to obtain a visually pleasing display of the data. Lamberti and Manni [10] presented and investigated the approximation order of a global shape preserving interpolating function using parametric cubic curves. The tension parameters were used to control the shape of curve. The authors derived the necessary and sufficient conditions for convexity whereas only sufficient conditions for positivity and monotonicity of data. Sarfraz et al. [11] developed a rational cubic spline with two families of free parameters for positive, monotone, and convex curve. Sufficient data dependent constraints were made for free parameters to maintain the shape of data. The scheme did not provide a liberty to designer for the refinement of positivity, monotonicity, and convexity-preserving curves.

Every developed method needs improvements or modifications to meet the required conditions. It can be used to get more accurate results. Many researchers can use new techniques to get more accurate results which are the contribution for the advancement of such results. The technique used in this paper is also a contribution to achieve the goal and has many prominent features over existing schemes.(i)In this work, the degree of smoothness is continuity while, in [2, 13], it is .(ii)In [6], the authors developed the scheme to achieve the desired shape of data by inserting extra knots between any two knots in the interval while we conserve the shape of convex data by only imposing constraints on free parameters without any extra knots.(iii)In [12], the authors developed schemes that work for equally spaced data while the proposed scheme works for both equally and unequally spaced data.(iv)The authors [14] assumed the certain function values and derivative values to control the shape of the data while, in this paper, data dependent constraints for the free parameters in the description of rational cubic function are used to achieve the required shape of the data.(v)The authors [8] achieved the values of derivative parameters by solving the three systems of linear equations, which is computationally expensive as compared to methods developed in this paper where there exists only one tridiagonal system of linear equations for finding the values of derivative parameters.(vi)Experimental and interpolation error analysis evidence suggests that the scheme is not only local in comparison with global scheme [10] and computationally economical but also produces smoother graphical results as compared to [9, 11].(vii)In [11], the interpolant does not allow the designer to modify the convex curve as per industrial demands to obtain a visually pleasing curve while in this paper two out of three shape parameters are left free for designer to refine the convexity preserving curve as desired.(viii)The proposed curve scheme is unique in its representation and applicable equally well for the data with derivatives or without derivatives.(ix)The proposed scheme is not concerned with an arbitrary degree; it is a rational cubic spline in the form of cubic/quadratic and by particular setting of shape parameters; it reduces to a standard cubic Hermite spline.

This paper is organized as follows. A piecewise rational cubic function with three shape parameters is rewritten in Section 2. Local convexity-preserving rational cubic spline Interpolation is discussed in Section 3. Error estimation of interpolation is discussed in Section 5. Sufficient numerical examples and discussion are given in Section 4 to prove the worth of the scheme. The concluding remarks are presented to end the paper.

#### 2. Rational Cubic Spline Function

Let be the given set of data points such that . A piecewise rational cubic function [3] with three shape parameters in each subinterval ,, is defined as with where , , and , , and are the positive shape parameters that are used to control the shape of interpolating curve and provide the designer liberty to refine the curve as desired. Let denote the derivative value at knots that is used for the smoothness of curve. Let and denote the first and second ordered derivatives with respect to .

The following interpolatory conditions are imposed for the continuity of the piecewise rational cubic function (1): with

From (3), the interpolating conditions produce the following system of linear equations: with where . The piecewise rational cubic function (1) is reformulated after using (2) as with

*Remark 1 (see [3]). *The system of linear equations defined in (5) is a strictly tridiagonal and has a unique solution for the derivatives parameters for all and . Moreover, it is efficient to apply LU decomposition method to solve the system for the values of derivatives parameters .

*Remark 2 (see [3]). *To make the rational cubic function smoother, continuity is applied at each knot. The system (5) involves linear equations while unknown derivative values are . So, two more equations are required for unique solution. For this, we impose end conditions at end knots as

*Remark 3 (see [3]). *For the values of shape parameters set as , , and in each subinterval , , the rational cubic function reduces to standard cubic Hermite spline [15].

#### 3. Local Convexity-Preserving Rational Cubic Spline Interpolation

In this section, we discuss the solution of convexity-preserving problem by using rational cubic function with three shape parameters. For this problem, we impose appropriate constraints on single shape parameter to conserve the shape of convex data. This requires some mathematical arguments so that the required shape of data is achieved.

Let be the given convex data set. This data set is said to be convex if

In similar way, it is concave if

For strictly convex curves, necessary condition for derivative parameters to obtain the smoothness is

For concave data we have

Necessary conditions for convexity are

Now the rational cubic function , defined in (7), is convex if and only if such that with

Since , and , it follows that :

Hence , , if the shape parameters satisfy the following constraints:

The above constraints can be rewritten as

The above discussion can be summarized as follows.

Theorem 4. *The rational cubic function (7) conserves the convex curve of strictly convex data in each subinterval if and only if the shape parameters , and satisfy (19).*

#### 4. Numerical Examples and Discussion

In this section, the efficiency of the proposed convexity-preserving scheme through several numerical examples is presented. A comparison of scheme with PCHIP (piecewise cubic Hermite interpolating polynomial, Built-in MATLAB program) and cubic Hermite spline scheme is also part of this section.

*Example 1. *A convex data set is taken in Table 1 which is borrowed from [4]. Figure 1(a) is drawn by cubic Hermite spline scheme [15] that does not conserve the local convexity through given convex data. Figure 1(b) is generated by PCHIP that does not look smooth because the function has only ability to remove the undulations in shape preserving curves. On the other hand, Figures 1(c) and 1(d) are generated by developed local convexity-preserving rational cubic function with different values of parameters and . The effect of shape parameters can be seen by noting the difference in smoothness of the curves in Figures 1(b), 1(c), and 1(d). Numerical results of Figure 1(d) are determined from developed scheme shown in Table 2.

**(a) Cubic Hermite spline curve**

**(b) PCHIP curve**

(c) Convexity-preserving rational cubic curve with , |

(d) Convexity-preserving rational cubic curve with , |

*Example 2. *A 2D convex data set is taken in Table 3 which is borrowed from [9]. Figure 2(a) is generated by cubic Hermite spline scheme [15] that does not maintain the convexity of given data. Figure 2(b) is produced by PCHIP to conserve the convexity of convex data but it looks tight at some data points. Figures 2(c) and 2(d) are generated by convexity-preserving rational cubic interpolant developed in Section 3. A comparison of convexity-preserving curve through convex data in these figures depicts the flaw of the cubic Hermite scheme and tightness of PCHIP. Figure 2(d) looks more pleasant and smooth as compared to Figure 2(b). Numerical results of Figure 2(d) are determined by developed convexity-preserving rational cubic spline scheme shown in Table 4.

**(a) Cubic Hermite curve**

**(b) PCHIP curve**

(c) convex rational cubic curve with , |

(d) convex rational cubic curve with , |

*Example 3. *The cubic Hermite spline scheme [15] and PCHIP have been used to draw Figures 3(a) and 3(b), respectively, through convex data given in Table 5 which is borrowed from [4]. The efficiency of the scheme developed in Section 3 can be seen in Figures 3(c) and 3(d). A remarkable difference in the smoothness with a pleasant graphical view is visible in these figures drawn by PCHIP and proposed rational cubic scheme due to the freedom granted to the designer on the values of shape parameters. Table 6 demonstrates the numerical results computed from the proposed scheme of Figure 3(d).

**(a) Cubic Hermite curve**

**(b) PCHIP curve**

(c) Local convexity-preserving rational cubic curve with , |

(d) Local convexity-preserving rational cubic curve with , |

*Example 4. *A convex data set is taken in Table 7. A nonconvex curve from this given data is drawn in Figure 4(a) by cubic Hermite scheme [15]. Figure 4(b) is produced by using PCHIP to conserve the shape of curve but the visual model looks tight as compared to proposed rational model, whereas Figures 4(c) and 4(d) are generated by convexity-preserving rational cubic function developed in Section 3. A comparison of convexity-preserving curve in these figures depicts the flaw of the cubic Hermite spline scheme and tightness of PCHIP. Figure 4(d) looks more pleasant and smooth as compared to Figures 4(c) and 4(b) due to different values of shape parameters. The numerical results computed from proposed scheme of Figure 4(d) are shown in Table 8.

**(a) Cubic Hermite spline curve**

**(b) PCHIP curve**

(c) rational cubic convex curve with , |

(d) rational cubic convex curve with , |

#### 5. Error Estimation

In this section, the error of interpolation is calculated by using the following Theorem 5 which was developed by Abbas et al. in [3] at some fixed values of free shape parameters , and various values of constrained parameter . Here, we take different values of shape parameters than [3] for the effectiveness of proposed interpolant.

Theorem 5 (see [3]). *The error of interpolating rational cubic function (7), for , in each subinterval is
**
where
**
where , , and are given in [3].*

Theorem 6 (see [3]). *For any given positive values of shape parameters , , and , the optimal error in Theorem 5 satisfies .*

*Proof. *See immediately Tables 9, 10, 11, and 12.

#### 6. Concluding Remarks

A rational cubic function has been developed in this paper for the smooth and attractive display of convex data. Three shape parameters were utilized for the description of function to conserve the shape of convex data. Simple data dependent sufficient constraints were derived for single shape parameter to insure convexity. Remaining two shape parameters have provided freedom to designer to modify the shape of the curve by simply adjusting the values of the shape parameters. No extra knots were inserted in the interval where the interpolant loses the convexity. The values of derivative parameters were achieved by solving the single system of linear equations in comparison with [8]; there exist three systems of linear equations for finding these values which is computationally expensive and time-consuming process. The proposed scheme is not only , smoother, local, and computationally economical but also visually pleasing as compared to schemes developed in [9, 11]. The proposed scheme works for both equally and unequally spaced data while the schemes developed in [12, 14] work for only equally spaced data.

#### Conflict of Interests

The authors declare that they have no conflict of interests regarding the publication of this paper.