1 Introduction

Bernstein–Bézier interpolating functions are used for the generation of smooth curves and surfaces. The Bézier functions interpolate first and last control points, and the intermediate control points determine the shape of the curve between the data points. However, these interpolating functions even in rational form do not preserve the intrinsic properties of data (positivity, monotonicity and convexity). The only possibility is to change the value of intermediate control points as hit and trial until the desired shape is obtained. The user is forced to go through this painstaking process for each data.

There exist sufficient polynomial interpolation techniques to preserve the positive, monotone and convex shape of data. Butt and Brodlie (1993) developed a simple algorithm to create positivity-preserving cubic Hermite interpolant. The data consisted of positive values and slopes at the data points. The authors in Butt and Brodlie (1993) interpolated the positive data values and associated slopes in each subinterval by the cubic Hermite interpolant. If in a subinterval the cubic Hermite interpolant failed to preserve positivity, then one or two extra knots were inserted into the concerned interval so that the resulting piecewise cubic Hermite interpolant preserved positivity. Duan et al. (2009) used rational cubic interpolant with two free parameters to control the value, convexity and inflection point of the interpolant at a point. The constraints were developed on these free parameters to acquire the desired results. Fuhr and Kallay (1992) used linear rational B-spline to interpolate monotone data with derivatives as monotone curves. Higham (1992) modified the method of inserting knot, proposed by Fritsch and Butland (1984), to preserve the shape of the monotone data. The monotonicity-preserving scheme presented in Higham (1992) was more efficient and less memory consuming as compared to Fritsch and Butland (1984). Higham (1992) claimed that the proposed algorithm was well suited for the data arising from the discrete approximate solution of an ODE. Hussain and Sarfraz (2008, 2009) developed a piecewise rational cubic function in the most generalized form with four free parameters to preserve the positive as well as monotone shape of the data. In the developed schemes, out of four parametres, two were constrained to preserve the shape of positive data and monotone data, whereas the other two were free to modify the shape of curve if desired. Lamberti and Manni (2001) used cubic Hermite for shape preservation of parametric data. In Lamberti and Manni (2001), the step length was constrained to preserve the shape of the data. Sarfraz (1992) developed a \(C^1\) and Verlan (2010) developed a \(C^2\) interpolation scheme to preserve the convex shape of the data.

Han et al. (2009) presented a cubic trigonometric curve in Bézier form. It was comparable to cubic Bézier curve, but somehow more efficient. In the cubic trigonometric Bézier curve, shape modification was made possible by shape parameters, keeping the control polygon unchanged. It was closer to the given control polygon than the cubic Bézier curves. Moreover, it could exactly represent ellipses.

The study of this paper develops a \(GC^1\) trigonometric interpolant to preserve the three shapes (positive, monotone and convex) of data, since an interpolant preserves the positive, monotone and convex shapes of data if the interpolant, and its first and second derivatives are positive over the entire domain. Keeping this in view, all the possible geometric configurations of interpolants and their first and second derivatives are discussed. The constraints are developed on parameters to ensure that the minimum value of the \(GC^1\) trigonometric interpolant and its derivative remain positive for each shape.

The shape-preserving interpolation scheme developed in this paper is beneficial due to the following reasons:

  • The trigonometric functions are considered unsuitable for shape-preserving interpolation due to their oscillatory behaviour. The trigonometric interpolant developed in this paper has two free parameters in each subinterval. These parameters are used to rein the oscillatory behaviour of trigonometric functions where needed.

  • The shape-preserving interpolation schemes developed in [Hussain and Sarfraz (2008, 2009), Sarfraz (1992)] used rational polynomial, but the trigonometric interpolant developed in this paper is non-rational. It requires less memory usage as compared to [Hussain and Sarfraz (2008, 2009), Sarfraz (1992)].

  • In [Butt and Brodlie (1993), Fritsch and Butland (1984), Fuhr and Kallay (1992), Higham (1992)], the non-rational interpolant (cubic Hermite) was used to preserve the shape of the data. The authors in [Butt and Brodlie (1993), Fritsch and Butland (1984), Fuhr and Kallay (1992), Higham (1992)] inserted extra knots in the subinterval where cubic Hermite failed to preserve the shape of the data. The trigonometric interpolation scheme proposed in this paper does not need to insert an extra knot.

  • The authors in Lamberti and Manni (2001) constrained step length to preserve the shape of the data, whereas the trigonometric interpolation scheme developed in this paper is equally applicable to both uniform and nonuniform data.

  • The proposed interpolation scheme produces a unique curve for the given data and selected values of parameters.

  • The developed trigonometric interpolant inherits all the properties of the Bézier curve. It can be termed as trigonometric Bézier function.

  • Unlike Verlan (2010), the degree of interpolant is same for all the data points.

  • An alternate scheme is developed to preserve the shape of the data.

The rest of the paper is organized as follows. Section 2 presents Bézier-like trigonometric functions. Section 3 develops \(GC^1\) trigonometric functions with two free parameters to control the shape of data. Section 4 addresses the problem of positive, monotone and convex data interpolation. Section 5 is of numerical examples and Sect. 6 concludes the paper.

2 Quadratic trigonometric functions

Let \(\{ {( {x_i,f_i }),i=0,1,2,\ldots ,n}\}\) be the given set of data points defined over the interval \([ {a,b}]\), where \(a=x_0 <x_1 <x_2 <\cdots <x_n =b\). The piecewise quadratic trigonometric function is defined as:

$$\begin{aligned} S_i (x)=\sum \limits _{k=0}^3 {B_k ( x)P_k,} \quad \forall \, x\in [ {x_i ,x_{i+1} }], \end{aligned}$$
(1)

where

$$\begin{aligned} B_0 (x)&= ( {1-\mathrm{Sin}\theta })^2, \quad B_1 ( x)=2\mathrm{Sin}\theta ( {1-\mathrm{Sin}\theta }),\quad B_2 ( x)=2\mathrm{Cos}\theta ( {1-\mathrm{Cos}\theta }),\\ B_3 ( x)&= ( {1-\mathrm{Cos}\theta })^2, \quad h_i =x_{i+1} -x_i, \quad \delta =\frac{x-x_i }{h_i }, \quad \theta =\frac{\pi }{2}\delta , \quad i=0,1,2,\ldots ,n-1. \end{aligned}$$

\(B_k ( x),\quad k=0,1,2,3\) are the quadratic trigonometric basis functions and \(P_k, k=0,1,2,3\) are the control points.

The quadratic trigonometric functions defined in (1) have the following properties:

  1. 1.

    End point interpolation: The quadratic trigonometric functions (1) interpolate the first and last control point, i.e. \({S_i ( {x_i })}|_{\theta =0} =P_0 \) and \({S_i ( {x_{i+1} })}|_{\theta =\textstyle {\pi \over 2}} =P_3\).

  2. 2.

    Convex hull property: The sum of the basis functions is one, i.e. \(\sum \nolimits _{k=0}^3 {B_k ( x)} =1,\) also the basis functions \(B_k ( x),\, k=0,1,2,3\) are non-negative. Hence the graphical display of quadratic trigonometric functions (1) is bounded in the convex hull of control points \(P_k,\, k=0,1,2,3.\)

  3. 3.

    Invariance under the affine transformation: The quadratic trigonometric functions are invariant under the affine transformations.

Let \(T\) be an affine transformation defined as: \(T( X)=AX+T_1,\)

where \(X\) is the vector to be transformed, \(A\) is the transformation matrix and \(T_1 \) is the translation vector.

Applying the affine transformation \(T\) to the quadratic trigonometric functions (1), we have

$$\begin{aligned} T(S_i (x))=T\left( {\sum \limits _{k=0}^3 {B_k ( x)P_k } }\right) =A\sum \limits _{k=0}^3 {B_k ( x)} P_k +T_1. \end{aligned}$$
(2)

Since \(\sum \nolimits _{k=0}^3 {B_k ( x)} =1,\) the expression (2) can be written as:

$$\begin{aligned} T( {S_i ( x)})=A\sum \limits _{k=0}^3 {B_k ( x)P_k +\sum \limits _{k=0}^3 {B_k ( x)T_1 } } =\sum \limits _{k=0}^3 {B_k ( x)( {AP_k +T_1 })} =\sum \limits _{k=0}^3 {B_k ( x)T( {P_k }).} \end{aligned}$$

It can be easily observed that quadratic trigonometric functions (1) behave like Bézier function, but enjoy four control points instead of three in quadratic structure.

3 GC\(^{1}\) trigonometric functions

On applying the \(C^1\)-continuity conditions, \(S_i ( {x_i })=f_i, S_i ( {x_{i+1} })=f_{i+1}, {S}'_i ( {x_i })=d_i, {S}'_i ( {x_{i+1} })=d_{i+1} \), to the quadratic trigonometric functions (1), it takes the form in the following subinterval \([ {x_i,x_{i+1} }]\):

$$\begin{aligned} S_i (x)&= ( {1-\mathrm{Sin}\theta })^2f_i +2\mathrm{Sin}\theta ( {1-\mathrm{Sin}\theta })( {f_i +\frac{h_i d_i }{\pi }})+2\mathrm{Cos}\theta ( {1-\mathrm{Cos}\theta }) \nonumber \\&\times \left( {f_{i+1} -\frac{h_i d_{i+1} }{\pi }}\right) +( {1-\mathrm{Cos}\theta })^2f_{i+1}. \end{aligned}$$
(3)

The quadratic trigonometric functions (3) have fixed values of tangents at the end points of interval. The flexible tangents are achieved by the following replacement in (3)

$$\begin{aligned} d_i \rightarrow \frac{d_i }{\alpha _i }\quad \hbox {and}\quad d_{i+1} \rightarrow \frac{d_{i+1} }{\beta _i }. \end{aligned}$$

The quadratic trigonometric functions (3) become \(GC^1\) quadratic trigonometric functions as:

$$\begin{aligned} S_i ( x)=\sum \limits _{k=0}^3 {B_k (x)A_k }, \end{aligned}$$
(4)

where

$$\begin{aligned} A_0 =f_i, \quad A_1 =f_i +\frac{h_i d_i }{\pi \alpha _i }, \quad A_2 =f_{i+1} -\frac{h_i d_{i+1} }{\pi \beta _i },\quad A_3 =f_{i+1},\;i=0,1,2,\ldots ,n-1. \end{aligned}$$

\(\alpha _i,\quad \beta _i >0\) are the free parameters.

3.1 Error bounds of quadratic trigonometric function

In this section, the interpolation error of \(GC^1\) quadratic trigonometric functions (4) is investigated. It is assumed that data are generated from a function \(f( x)\in C^3[ {x_0,x_n }].\) The absolute interpolation error in the subinterval \(I_i =[ {x_i,x_{i+1}}]\) is:

$$\begin{aligned} |{f( x)-S_i (x)}|\le \frac{1}{2}\Vert {f^{( 3)}( \tau )} \Vert \int \limits _{x_i }^{x_{i+1} } {R_x [ {( {x-\tau })_+^2 } ]\,\mathrm{d}\tau }, \end{aligned}$$
(5)

where \(R_x \)is known as Peano kernel and \(( {x-\tau })_+^2 \) is the truncated power function. The integral involved in (5) is expressed as:

$$\begin{aligned} \int \limits _{x_i }^{x_{i+1} } {| {R_x[{( {x-\tau })_+^2}]}|\,\mathrm{d}\tau =\int \limits _{x_i }^x {| {r( {\tau ,x})}|} \,\mathrm{d}\tau +\int \limits _x^{x_{i+1} } {| {s( {\tau ,t})}|\,\mathrm{d}\tau .}} \end{aligned}$$

For the \(GC^1\) quadratic trigonometric function (4), we have

$$\begin{aligned} r( {\tau ,x})&= ( {x-\tau })^2-\left\{ {( {B_2 +B_3 })( {x_{i+1} -\tau })^2-\frac{2h_i B_2 ( {x_{i+1} -\tau })}{\pi \beta _i }} \right\} , \end{aligned}$$
(6)
$$\begin{aligned} s({\tau ,x})&= -\left\{ {( {B_2 +B_3 })( {x_{i+1} -\tau })^2-\frac{2h_i B_2 ( {x_{i+1} -\tau })}{\pi \beta _i }} \right\} . \end{aligned}$$
(7)

where \(B_i( x), \, i=0,1,2,3\) are the quadratic trigonometric basis functions defined in Sect. 2.

It is observed that, for all \(\theta \in [ {0,\frac{\pi }{2}} ],\;r( {x,x_i })=0.\) Substituting \(\tau =x\) in (6) and after some simplification, it takes the form

$$\begin{aligned} r( {x,x})=-h_i^2 \left\{ {( {B_2 +B_3 })( {1-\delta })-\frac{2B_2 }{\pi \beta _i }} \right\} . \end{aligned}$$

The roots of \(r({x,x})\) are: \(\delta =0,\;\delta =1,\;\delta =1-\frac{2( {2-\beta _i })}{\pi \beta _i }.\) Let \(1-\frac{2( {2-\beta _i })}{\pi \beta _i }=\delta ^*\)(say).

If \(\beta _i \in [{\frac{4}{\pi +2},2}]\), the roots of \(r( {x,x})\) in \([{0,1}]\) are \(\delta =0,\delta =1\), \(\delta ^*=1-\frac{2( {2-\beta _i })}{\pi \beta _i}.\) If \(\beta _i \notin [{\frac{4}{\pi +2},2}],\) then the roots of \(r( {x,x})\) in \([{0,1}]\) are \(\delta =0\) and \(\delta =1\). It is observed that \(s( {x,x_{i+1} })=0.\) Hence to calculate the roots of \(s( {x,x}),\) it is rearranged as:

$$\begin{aligned} s( {x,x})=-h_i^2 \left\{ {( {B_2 +B_3 })( {1-\delta })-\frac{2B_2 }{\pi \beta _i }} \right\} . \end{aligned}$$

To compute the roots of \(r({\tau ,x}),\) it is rearranged as:

$$\begin{aligned} r( {\tau ,x})&= ( {1-B_2 -B_3 })( {x-\tau })^2+2h_i \left( {\frac{B_2 }{\pi \beta _i }-( {B_2 +B_3 })( {1-\delta })}\right) ( {x-\tau }) \\&\quad +h_i^2 \left( {\frac{2B_2 }{\pi \beta _i }( {1-\delta })-( {B_2 +B_3 })( {1-\delta })^2}\right) . \\ \end{aligned}$$

The roots of \(r( {\tau ,x})\)are

$$\begin{aligned} \tau _1^*=x+h_i \left( {\frac{B-D}{A}}\right) \quad \text{ and }\quad \tau _2^*=x+h_i \left( {\frac{B+D}{A}}\right) , \end{aligned}$$

where

$$\begin{aligned} A&= ( {1-B_2 -B_3 }),\;B=\left( {\frac{B_2 }{\pi \beta _i}-( {B_2 +B_3 })( {1-\delta })}\right) , \\ D&= \sqrt{\left( {\frac{B_2 }{\pi \beta _i }-( {B_2 +B_3 })( {1-\delta })}\right) ^2-( {1-B_2 -B_3 })\left( {\frac{2B_2 }{\pi \beta _i }-( {B_2 +B_3 })( {1-\delta })}\right) }. \\ \end{aligned}$$

The roots of \(s( {\tau ,x})\) are

$$\begin{aligned} \tau ^*=x_{i+1} \quad \hbox {and}\quad \tau ^*=x_{i+1} -\frac{2h_i B_2 }{\pi \beta _i ( {B_2 +B_3 })}. \end{aligned}$$

Depending on the values of \(\delta \) and \(\beta _i ,\) the following observations are made: If \(\delta \le \delta ^*\) and \(\beta _i \in \left[ {\frac{4}{\pi +2},2} \right] ,\tau _1^*\in \left[ {x_i,x} \right] \) and \(\tau _2^*\notin \left[ {x_i,x} \right] \).

If\(\delta \ge \delta ^*\) and \(\beta _i \in \left[ {\frac{4}{\pi +2},2} \right] \), then \(\tau _1^*,\tau _2^*\in \left[ {x_i,x} \right] .\)

If \(0\le \delta \le 1\) and \(\beta _i >2,\tau _1^*\in \left[ {x_i ,x} \right] \) and \(\tau _2^*\notin \left[ {x_i,x} \right] \).

If \(0\le \delta \le 1\) and \(\beta _i <\frac{4}{\pi +2},\tau _1^*,\tau _2^*\in \left[ {x_i,x} \right] .\)

If \(\delta \le \delta ^*\) and \(\beta _i \in \left[ {\frac{4}{\pi +2},2} \right] ,\tau ^*\in \left[ {x,x_{i+1} } \right] \)

If \(\delta \ge \delta ^*\) and \(\beta _i \in \left[ {\frac{4}{\pi +2},2} \right] ,\tau ^*\notin \left[ {x,x_{i+1} } \right] \).

If \(0\le \delta \le 1\) and \(\beta _i >2,\tau ^*\notin \left[ {x,x_{i+1} } \right] \).

If \(0\le \delta \le 1\) and \(\beta _i <\frac{4}{\pi +2},\tau ^*\notin \left[ {x,x_{i+1} } \right] \). The above discussion provides the different values of absolute error depending on the choice of \(\delta \) and \(\beta _i \).

Case 1: For \(0\le \delta \le \delta ^*,\;\beta _i \in [{\frac{4}{\pi +2},2}],\) the absolute error in \(I_i =[{x_i,x_{i+1} }]\) is

$$\begin{aligned} |{f( x)-S_i ( x)}|\le \frac{1}{2}\Vert {f^{( 3)}(\tau )} \Vert h_i^3 \omega _1 ({\alpha _i,\beta _i,\delta }), \end{aligned}$$

where

$$\begin{aligned} \omega _1&= \int \limits _{x_i }^x {|{r( {\tau ,x})}|}\,\mathrm{d}\tau +\int \limits _x^{x_{i+1} } {|{s( {\tau ,x})}|}\, \mathrm{d}\tau \\&= -\int \limits _{x_i }^{\tau _1^*} {r( {\tau ,x})\,\mathrm{d}\tau +\int \limits _{\tau _1^*}^x {r( {\tau ,x})\,\mathrm{d}\tau }} \;-\int \limits _x^{\tau ^*} {s( {\tau ,x})}\,\mathrm{d}\tau +\int \limits _{\tau ^*}^{x_{i+1} } {s( {\tau ,x})}\,\mathrm{d}\tau \\&= \left\{ {\frac{-2(1-B_2 -B_3 )}{3}\left( {\frac{B-D}{A}}\right) ^3} \right. +2\left( {\frac{B_2 }{\pi \beta _i }-( {B_2 +B_3 })( {1-\delta })}\right) \left( {\frac{B-D}{A}}\right) ^2\\&-2\left( {\frac{2B_2 }{\pi \beta _i }(1-\delta )-(B_2 +B_3 )(1-\delta )^2}\right) \left( {\frac{B-D}{A}}\right) -\frac{(1-B_2 -B_3 )}{3}\delta ^3 \\&-\left( {\frac{B_2 }{\pi \beta _i }-( {B_2 +B_3 })( {1-\delta })}\right) \delta ^2-\left( {\frac{2B_2 }{\pi \beta _i }( {1-\delta })-( {B_2 +B_3 })( {1-\delta })^2}\right) \delta \\&+\frac{8B_2^3 }{3( {\pi \beta _i })^3( {B_2 +B_3 })^2}-\frac{B_2 }{\pi \beta _i }( {1-\delta })^2+\left. {\left( {\frac{B_2 +B_3 }{3}}\right) ( {1-\delta })^3} \right\} . \\ \end{aligned}$$

Case 2: For \(\delta ^*\le \delta \le 1,\;\beta _i \in [{\frac{4}{\pi +2},2}],\) we have

$$\begin{aligned} |{f( x)-S_i ( x)}|\le \frac{1}{2}\Vert {f^{( 3)}( \tau )} \Vert h_i^3 \omega _2 ({\alpha _i,\beta _i,\delta }), \end{aligned}$$

where

$$\begin{aligned} \omega _2&= \int \limits _{x_i }^x {|{r( {\tau ,x})}|}\,\mathrm{d}\tau +\int \limits _x^{x_{i+1} } {|{s({\tau ,x})}|}\,\mathrm{d}\tau \\&= \int \limits _{x_i }^{\tau _1^*} {r({\tau ,x})\,\mathrm{d}\tau -\int \limits _{\tau _1^*}^{\tau _2^*} {r({\tau ,x})}\,\mathrm{d}\tau +\int \limits _{\tau _2^*}^x {r({\tau ,x})\,\mathrm{d}\tau } } \;+\int \limits _x^{x_{i+1} } {s( {\tau ,x})} \,\mathrm{d}\tau \\&= \left\{ {\frac{2( {1-B_2 -B_3 })}{3}\left( {\frac{B-D}{A}}\right) ^{3}-2\left( {\frac{B_2 }{\pi \beta _i }-( {B_2 +B_3 })( {1-\delta })}\right) \left( {\frac{B-D}{A}}\right) ^2} \right. \\&+\left( {\frac{2B_2 }{\pi \beta _i }( {1-\delta })-( {B_2 +B_3 })( {1-\delta })^2}\right) \left( {\frac{B-D}{A}}\right) -\frac{2( {1-B_2 -B_3 })}{3}\left( {\frac{B+D}{A}}\right) ^3 \\&+2\left( {\frac{B_2 }{\pi \beta _i }-( {B_2 +B_3 })( {1-\delta })}\right) \left( {\frac{B+D}{A}}\right) ^2+\left( {\frac{1-B_2 -B_3 }{\beta _i }}\right) \delta ^3 \\&-2\left( {\frac{2B_2 }{\pi \beta _i }( {1\!-\!\delta })\!-\!( {B_2 \!+\!B_3 })( {1\!-\!\delta })^2}\right) \left( {\frac{B+D}{\beta _i }}\right) +\left( {\frac{B_2 }{\pi \beta _i }\!-\!( {B_2 +B_3 })( {1-\delta })}\right) \delta ^2 \\&+\left. {\left( {\frac{2B_2 }{\pi \beta _i }( {1\!-\!\delta })\!-\! ( {B_2 \!+\!B_3 })( {1\!-\!\delta })^2}\right) \delta \!+\!( {1\!-\!\delta })^2 \left( {\frac{3B_2 \!-\!\pi \beta _i ( {B_2 +B_3 })( {1-\delta })}{3\pi \beta _i }}\right) } \right\} . \end{aligned}$$

Case 3: For \(0\le \delta \le 1,\;\beta _i >2,\) we have

$$\begin{aligned} | {f( x)-S_i ( x)}|\le \frac{1}{2}\Vert {f^{( 3)}( \tau )}\Vert h_i^3 \omega _3 ( {\alpha _i,\beta _i,\delta }),\;\omega _3 ( {\alpha _i,\beta _i,\delta })=\omega _1 ( {\alpha _i,\beta _i,\delta }). \end{aligned}$$

Case 4: For \(0\le \delta \le 1,\;\beta _i <\frac{4}{\pi +2},\)we have

$$\begin{aligned} | {f( x)-S_i ( x)}|\le \frac{1}{2}\Vert {f^{( 3)}( \tau )} \Vert h_i^3 \omega _4 ( {\alpha _i,\beta _i,\delta }),\;\omega _4 ( {\alpha _i,\beta _i,\delta })=\omega _2 ( {\alpha _i,\beta _i,\delta }). \end{aligned}$$

Theorem 1

The error of \(GC^1\) quadratic trigonometric function (4) in each subinterval \(I_i =[{x_i,x_{i+1}}]\) for \(f( x)\in C^3[{x_0,x_n}]\) is

$$\begin{aligned}&|{f( x)-S_i(x)}|\le \frac{1}{2}\Vert {f^{(3)}(\tau )} \Vert h_i^3 c_i,\;c_i =\mathop {\max }\limits _{0\le \delta \le 1} \omega ( {\alpha _i,\beta _i,\delta }),\\&\omega ( {\alpha _i,\beta _i,\delta })=\left\{ {{\begin{array}{l@{\quad }l@{\quad }l} \displaystyle {\max \omega _1 ( {\alpha _i,\beta _i,\delta })} \quad &{} {0\le \delta \le \delta ^*} \quad &{} {\frac{4}{\pi +2}\le \beta _i \le 2} \\ \displaystyle {\max \omega _2 ( {\alpha _i,\beta _i,\delta })} \quad &{} {\delta ^*\le \delta \le 1} \quad &{} {\frac{4}{\pi +2}\le \beta _i \le 2}\\ \displaystyle {\max \omega _3 ( {\alpha _i,\beta _i,\delta })} \quad &{} {0\le \delta \le 1} \quad &{} {\beta _i >2} \\ \displaystyle {\max \omega _4 ( {\alpha _i,\beta _i,\delta })} \quad &{} {0\le \delta \le 1} \quad &{} {\beta _i <\frac{4}{\pi +2}}\\ \end{array} }} \right. \end{aligned}$$

4 Shape-preserving curve interpolation

In this section, the three shape properties, positivity, monotonicity and convexity, of 2D data are discussed. Constraints are developed on free parameters \(\alpha _i \) and \(\beta _i\) in the description of \(GC^1\) quadratic trigonometric function to preserve the shape of data.

4.1 Positive curve interpolation

Let \(\{{({x_i,f_i }), i=0,1,2,\ldots ,n}\}\) be the positive data defined over the interval \([{a,b}]\) with partition \(a=x_0 <x_1 <x_2 <\cdots <x_n =b,\;f_i >0,\;i=0,1,2,\ldots ,n.\)

The \(GC^1\) quadratic trigonometric functions (4) preserve the positivity if

$$\begin{aligned} S_i ( x)>0,\;\forall x\in [{x_i,x_{i+1}}],\;i=0,1,2,\ldots ,n-1. \end{aligned}$$

\(S_i (x)\) has one of the following graphical representations:

  1. I.

    \(S_i ( x)\) is either increasing or decreasing \(\forall \,\,x\in [{x_i,x_{i+1}}].\) Extrema lie at the end points of the interval \([{x_i,x_{i+1}}]\). In this case, if minima lie at one of the end points then maxima will lie at the other.

  2. II.

    \(S_i (x)\) is concave over the whole interval \([ {x_i ,x_{i+1}}].\) In this case, minima lie at the end points of the curve.

  3. III.

    \(S_i (x)\) is convex over the whole interval\([{x_i ,x_{i+1}}].\) In this case, local minima lie in the interior, i.e. at points \(x\in ( {x_i,x_{i+1} }).\)

  4. IV.

    There are inflection points in the interval \(({x_i,x_{i+1} })\) (function changes it concavity). In this case, local extrema lie at the points \(x\in ( {x_i,x_{i+1} }).\)

In case (I) and (II),\( S_i ( x)\) is positive \(\forall x\in [ {x_i ,x_{i+1} }]\) if \(S_i ( x)>0\) at the end points of the interval \([x_i,x_{i+1} ].\) Since\( S_i ( {x_i })=f_i\) and \(S_i ( {x_{i+1} })=f_{i+1},\) then \(S_i ( x)>0,\;\forall x\in [ {x_i ,x_{i+1}}].\)

In cases (III) and (IV), we shall determine the critical points of (4). These critical points will be points of relative minima or maxima. We shall determine constraints on free parameters \(\alpha _i \) and \(\beta _i \)to ensure the positivity of quadratic trigonometric function at all extrema.

To determine the critical points of \(S_i ( x)\), it is more convenient to express \(S_i ( x)\) as a function of two variables. Let \(u=Sin\theta and \;v=Cos\theta ,\) (4) takes the form:

$$\begin{aligned} S_i ( {u,v})=( {1-u})^2A_0 +2u( {1-u})A_1 +2v( {1-v})A_2 +( {1-v})^2A_3. \end{aligned}$$
(8)

The critical points of \(S_i ( {u,v})\) are obtained from \(\frac{\partial S_i ( {u,v})}{\partial u}=0\) and \(\frac{\partial S_i ( {u,v})}{\partial v}=0\).

The critical points are \(u_*=\frac{A_0 -A_1 }{A_0 -2A_1 }\) and \(v_*=\frac{A_3 -A_2 }{A_3 -2A_2 }.\)

Since Sin\(\theta ,\mathrm{Cos}\theta \in [{0,1}]\), we shall determine the values of free parameters \(\alpha _i \) and \(\beta _i \) for which \(u_*,v_*\in [{0,1}].\) If \(u_*=0,\) then \(v_*=1\) and vice versa. In either case \(S_i ( {u,v})=0.\) Hence, we shall verify the range of \(\alpha _i \) and \(\beta _i \) for which \(u_*,v_*\in ( {0,1}).\)

\(u_*>0\) if either of the following possibilities is true:

  1. (a)

    If \(A_0 -A_1 >0\,\) and \(A_0 -2A_1 >0,\) then \(\alpha _i <\frac{-2h_i d_i }{\pi f_i }.\)

  2. (b)

    \(A_0 -A_1 <0\,\) and \(A_0 -2A_1 <0,\) then \(\alpha _i >\frac{-2h_i d_i}{\pi f_i }.\)

\(u_*<1,\) then the possible cases are:

  1. (a)

    \(A_1 <0\,\) provided that \(A_0 -2A_1 >0.\) It is true only if \(\alpha _i <\frac{-h_i d_i }{\pi f_i }.\)

  2. (b)

    \(A_1 >0\,\) provided that \(A_0 -2A_1 <0.\) It is true only if \(\alpha _i >\frac{-h_i d_i }{\pi f_i }.\)

Thus, it can be concluded that \(u_*\in ( {0,1})\) if

  1. (i)

    \(\alpha _i <\mathrm{Min}\{ {\frac{-h_i d_i }{\pi f_i },\frac{-2h_i d_i }{\pi f_i }}\},\) when \(d_i <0\).

  2. (ii)

    \(\alpha _i >\mathrm{Max}\{ {\frac{-h_i d_i }{\pi f_i },\frac{-2h_i d_i }{\pi f_i }}\},\) when \(d_i >0.\)

In a similar way, it can be observed that \(v_*\in ( {0,1})\) if

  1. (i)

    \(\beta _i <\mathrm{Min}\{ {\frac{h_i d_{i+1} }{\pi f_{i+1} },\frac{2h_i d_{i+1} }{\pi f_{i+1} }}\},\) when \(d_{i+1} >0.\)

  2. (ii)

    \(\beta _i >\mathrm{Max}\{ {\frac{h_i d_{i+1} }{\pi f_{i+1} },\frac{2h_i d_{i+1} }{\pi f_{i+1} }}\},\) when \(d_{i+1} <0.\)

After substituting the values of \(u_*\) and \(v_*, \) (8) becomes as follows:

$$\begin{aligned} S_i ( {u_*,v_*})=\left( {\frac{A_1 }{A_0 -2A_1 }}\right) ^2( {2A_1 -A_0 })+\left( {\frac{A_2 }{A_3 -2A_2 }}\right) ^2( {2A_2 -A_3 }). \end{aligned}$$
(9)

From (9), it is clear that \(S_i ( {u_*,v_*})>0\) if \(2A_1 -A_0 >0\) and \(2A_2 -A_3 >0. 2A_1 -A_0 >0\) and \(2A_2 -A_3 >0\) if

$$\begin{aligned} \alpha _i >\mathrm{Max}\left\{ {\frac{-h_i d_i }{\pi f_i },\frac{-2h_i d_i }{\pi f_i}} \right\} \hbox {and} \quad \beta _i >\mathrm{Max}\left\{ {\frac{h_i d_{i+1} }{\pi f_{i+1} },\frac{2h_i d_{i+1} }{\pi f_{i+1} }} \right\} . \end{aligned}$$

All the above discussion can also be summarized as:

Theorem 2

The piecewise \(GC^1\) quadratic trigonometric interpolant \(S_i ( x)\), defined over the interval \([{a,b}]\) in (4), is positive if parameters \(\alpha _i \) and \(\beta _i \)in each subinterval satisfy the following conditions

$$\begin{aligned} \alpha _i >\mathrm{Max}\left\{ {0,\frac{-h_i d_i }{\pi f_i },\frac{-2h_i d_i }{\pi f_i }} \right\} \quad \beta _i >\left\{ {0,\frac{h_i d_{i+1} }{\pi f_{i+1} },\frac{2h_i d_i }{\pi f_{i+1} }} \right\} . \end{aligned}$$

The above constraints can be rearranged as:

$$\begin{aligned} \alpha _i =l_i +\mathrm{Max}\left\{ {0,\frac{-h_i d_i }{\pi f_i },\frac{-2h_i d_i }{\pi f_i }} \right\} \quad \beta _i =m_i +\left\{ {0,\frac{h_i d_{i+1} }{\pi f_{i+1} },\frac{2h_i d_i }{\pi f_{i+1} }} \right\} ,\;l_i >0,\;m_i >0. \end{aligned}$$

4.2 Monotone curve interpolation

Let \(\{{( {x_i,f_i }),i=0,1,2,\ldots ,n}\}\) be the monotone data defined over the interval \([{a,b}].\) The necessary conditions for the monotonicity of data are

  1. (i)

    \(\Delta _i =0\,\) then \(d_i =0\,\) and \(d_{i+1} =0;\)

  2. (ii)

    \(\Delta _i \ne 0\,\) then \(sgn(d_i )=sgn( {d_{i+1} })=sgn( {\Delta _i }).\,\)

In this section, we assume that the data under consideration is monotonically increasing (\(\Delta _i >0,d_i >0,d_{i+1} >0)\). The monotonically decreasing data(\(\Delta _i <0,d_i <0,d_{i+1} <0)\) can be treated in a similar way.

The piecewise quadratic trigonometric functions (4) are monotone if

$$\begin{aligned} {S}'_i ( x)>0,\;\forall x\in [{x_i,x_{i+1}}], \end{aligned}$$

where

$$\begin{aligned} {S}'_i ( x)=( {1-\mathrm{Sin}\theta })\mathrm{Cos}\theta \,C_0 +\mathrm{Sin}\theta \mathrm{Cos}\theta \,C_1 +( {1-\mathrm{Cos}\theta })\mathrm{Sin}\theta \,C_2, \end{aligned}$$
$$\begin{aligned} C_0 =\frac{d_i }{\alpha _i },\;C_1 =\pi \,\Delta _i -\left( {\frac{d_i }{\alpha _i }+\frac{d_{i+1} }{\beta _i }}\right) ,\;C_2 =\frac{d_{i+1} }{\beta _i }. \end{aligned}$$

\({S}'_i ( x)\) also have any one of the graphical representations (I)–(IV) discussed in Sect. 4.1.

In case (I)–(II), \({S}'_i ( x)\) is either increasing or decreasing or concave over the whole domain. The monotonicity can be established by assuring the positive value of \({S}'_i ( x)\) at the end points of the interval. Since \({S}'_i ( {x_i })=\frac{d_i }{\alpha _i },{S}'_i ( {x_{i+1} })=\frac{d_{i+1} }{\beta _i },\) \({S}'_i ( x)\) is positive over the whole domain.

In case (III)–(IV), \({S}'_i ( x)\) is convex over the whole domain or has inflection points in the interval; then we shall determine the critical points of \({S}'_i ( x).\) The constraints will be derived on \(\alpha _i \) and \(\beta _i \) to assure a positive value of \({S}'_i ( x)\) at the critical points. In this case, \({S}'_i ( x)\) will be positive if the minimum value of \({S}'_i ( x)\) is positive in the whole interval.

$$\begin{aligned} {S}'_i ( {u,v})=( {1-u})vC_0 +uvC_1 +( {1-v})uC_2, \end{aligned}$$
(10)

where \(u=\mathrm{Sin}\theta , \quad v=\mathrm{Cos}\theta .\)

The critical point of \({S}'_i ( {u,v})\) is \(( {u_*,v_*})=\left( {\frac{C_0 }{C_0 +C_2 -C_1 },\frac{C_2 }{C_0 +C_2 -C_1 }}\right) .\)

  1. (a)

    \(u_*>0\) and \(v_*>0,\) if \(C_0 +C_2 -C_1 >0\,\) where \(C_0 +C_2 -C_1 =-\pi \Delta _i +\frac{2d_i }{\alpha _i }+\frac{2d_{i+1} }{\beta _i }.\,\,C_0 +C_2 -C_1 >0\,\) if \(\alpha _i <\frac{4d_i }{\pi \Delta _i }\) and \(\beta _i <\frac{4d_{i+1} }{\pi \Delta _i }.\)

  2. (b)

    \(u_*<1\) and \(v_*<1\) if \(\frac{C_0 }{C_0 +C_2 -C_1 }<1\) or \(C_2 -C_1 >0,\) where \(C_2 -C_1 =-\pi \Delta _i +\frac{d_i }{\alpha _i }+\frac{2d_{i+1} }{\beta _i }. \quad C_2 -C_1 >0\) if \(\alpha _i <\frac{2d_i }{\pi \Delta _i }\) and \(\beta _i <\frac{4d_{i+1} }{\pi \Delta _i }.\)

From the above discussion it can be concluded that \(u_*,v_*\in ( {0,1})\) if

$$\begin{aligned} \alpha _i <\mathrm{Min}\left\{ {\frac{2d_i }{\pi \Delta _i },\frac{4d_i }{\pi \Delta _i }}\right\} \quad \hbox {and}\quad \beta _i <\mathrm{Min}\left\{ {\frac{2d_{i+1} }{\pi \Delta _i },\frac{4d_{i+1} }{\pi \Delta _i }} \right\} . \end{aligned}$$
$$\begin{aligned} {S}'_i ( {u_*,v_*})=\frac{C_0 C_1 }{( {C_0 +C_2 -C_1 })}, \end{aligned}$$
(11)

\({S}'_i ( {u_*,v_*})>0\) if \(C_0 +C_2 -C_1 >0.\)

All the above discussions can be summarized as:

Theorem 3

The piecewise \(GC^1\) quadratic trigonometric interpolant \(S_i ( x)\), defined over the interval \([{a,b}],\) in (4), is monotone if the parameter \(\alpha _i \) and \(\beta _i\) in each subinterval \(I_i =[ {x_i,x_{i+1}}]\) satisfy the following conditions:

$$\begin{aligned} \alpha _i <\mathrm{Min}\left\{ {\frac{2d_i }{\pi \Delta _i },\frac{4d_i }{\pi \Delta _i }} \right\} \;\text{ and } \quad \beta _i <\mathrm{Min}\left\{ {\frac{2d_{i+1} }{\pi \Delta _i },\frac{4d_{i+1} }{\pi \Delta _i }} \right\} . \end{aligned}$$

The above constraints can be rearranged as:

$$\begin{aligned} \alpha _i =c_i +\mathrm{Min}\left\{ {\frac{2d_i }{\pi \Delta _i },\frac{4d_i }{\pi \Delta _i }} \right\} , \quad \beta _i =d_i +\mathrm{Min}\left\{ {\frac{2d_{i+1} }{\pi \Delta _i },\frac{4d_{i+1} }{\pi \Delta _i }} \right\} , \end{aligned}$$

for any real number \(c_i,\;d_i <0.\)

4.3 Convex curve interpolation

Let \(\{{( {x_i,f_i }),i=0,1,2,\ldots ,n}\}\) be the convex data defined over the interval \([{a,b}].\) The necessary conditions for the convexity of data are

$$\begin{aligned} d_i \le d_{i+1}, \quad \Delta _i \le \Delta _{i+1} \quad \text{ and }\quad d_i \le \Delta _i \le d_{i+1}. \end{aligned}$$

The piecewise \(GC^1\) quadratic trigonometric functions defined in (4) are convex if

$$\begin{aligned} {S}''_i ( x)>0,\;\forall x\in [{x_i,x_{i+1}}], \end{aligned}$$

where

$$\begin{aligned} {S}''_i ( x)=\frac{\pi }{2h_i }[{\mathrm{Cos}^2\theta D_0 +\mathrm{Sin}^2\theta D_1 -\mathrm{Sin}\theta \,C_0 +\mathrm{Cos}\theta \,C_1}], \end{aligned}$$
(12)

with \(D_0 =C_1 -C_0 -C_2 \) and \(D_1 =C_0 +C_2 -C_1.\)

\(S_i ( x)\) will be convex in the whole interval \([{x_i,x_{i+1} }],\) if \({S}''_i ( x)\) is positive at local minimas.

Compute theoretical points of \({S}''_i ( x)\) and derive the constraints on the free parameters \(\alpha _i \) and \(\beta _i ,\) such that the value of \({S}''_i ( x)\) is positive at the critical points. \({S}''_i ( x)\) is written as:

$$\begin{aligned} {S}''_i ( {u,v})=v^2D_0 +u^2D_1 -uC_0 +vC_1, \end{aligned}$$
(13)

where \(u=\mathrm{Sin}\theta \) and \(v=\mathrm{Cos}\theta .\)

The critical points of \({S}''_i ( {u,v})\) are \(u_*=\frac{C_0 }{2D_1 }\) and \(v_*=\frac{-C_2 }{2D_0 }.\)

  1. (a)

    \(u_*>0\) if either (\(C_0 >0\) and \(D_0 >0)\) or (\(C_0 <0\) and \(D_0 <0)\), where \(C_0 =\frac{d_i }{\alpha _i }\,\) and \(D_0 =\pi \Delta _i -2( {\frac{d_i }{\alpha _i }+\frac{d_{i+1} }{\beta _i }}).\;C_0 >0\) and \(D_0 >0,\) if \(\alpha _i >\frac{4d_i }{\pi \Delta _i }\) and \(\beta _i >\frac{4d_{i+1} }{\pi \Delta _i }.\;C_0 <0\) and \(D_0 <0,\) if \(\alpha _i <\frac{4d_i }{\pi \Delta _i }\) and \(\beta _i <\frac{4d_{i+1} }{\pi \Delta _i }.\)

  2. (b)

    \(u_*<1\) if either (\(C_0 <2D_0 \) and \(D_0 >0)\) or (\(C_0 >2D_0 \) and \(D_0 <0).C_0 <2D_0 \) and \(D_0 >0,\) if \(\alpha _i >\frac{3d_i }{\pi \Delta _i }\) and \(\beta _i >\frac{4d_{i+1} }{\pi \Delta _i }.\;C_0 >2D_0 \) and \(D_0 <0,\) if \(\alpha _i <\frac{3d_i }{\pi \Delta _i }\) and \(\beta _i <\frac{4d_{i+1} }{\pi \Delta _i }.\)

Thus \(u_*\in ( {0,1})\) if

  1. (i)

    \(\alpha _i >\mathrm{Max}\left\{ {\frac{3d_i }{\pi \Delta _i },\frac{4d_i }{\pi \Delta _i }} \right\} \) and \(\beta _i >\frac{4d_{i+1} }{\pi \Delta _i }\), when \(d_i >0.\)

  2. (ii)

    \(\alpha _i <\mathrm{Min}\left\{ {\frac{3d_i }{\pi \Delta _i },\frac{4d_i }{\pi \Delta _i }} \right\} \) and \(\beta _i <\frac{4d_{i+1} }{\pi \Delta _i },\) when \(d_i <0.\)

  1. (a)

    \(v_*>0,\) if (\(C_2 >0\) and \(D_1 <0)\) or (\(C_2 <0\) and \(D_1 >0).C_2 >0\) and \(D_1 <0,\) if \(\alpha _i <\frac{4d_i }{\pi \Delta _i }\) and \(\beta _i <\frac{4d_{i+1} }{\pi \Delta _i }\).\(C_2 <0\) and \(D_1 >0,\) if \(\alpha _i >\frac{4d_i }{\pi \Delta _i }\) and \(\beta _i >\frac{4d_{i+1} }{\pi \Delta _i }\).

  2. (d)

    \(v_*<1,\) if (\(-C_2 <2D_1 \) and \(D_1 >0)\) or (\(-C_2 >2D_1 \) and \(D_1 <0)\). \(-C_2 <2D_1 \) and \(D_1 >0,\) if \(\alpha _i <\frac{4d_i }{\pi \Delta _i }\) and \(\beta _i <\frac{5d_{i+1} }{\pi \Delta _i }.\;-C_2 >2D_1 \) and \(D_1 <0,\) if \(\alpha _i >\frac{4d_i }{\pi \Delta _i }\) and \(\beta _i >\frac{5d_{i+1} }{\pi \Delta _i }.\)

Thus, \(v_*\in ( {0,1})\) if

  1. (i)

    \(\alpha _i =\frac{4d_i}{\pi \Delta _i}\) and \(\frac{5d_{i+1} }{\pi \Delta _i }<\beta _i <\frac{4d_{i+1} }{\pi \Delta _i }\), when \(d_{i+1} <0.\)

  2. (ii)

    \(\alpha _i =\frac{4d_i }{\pi \Delta _i }\) and \(\frac{4d_{i+1} }{\pi \Delta _i }<\beta _i <\frac{5d_{i+1} }{\pi \Delta _i }\), when \(d_{i+1} <0.\)

$$\begin{aligned} {S}''_i ( x)( {u_*,v_*})=\frac{C_0 ^2}{4D_1 ^2}( {D_0 })+\frac{C_2 ^2}{4}\left( {\frac{-1}{D_1 }}\right) +\frac{C_0^2 }{2( {-D_1 })}. \end{aligned}$$

\({S}''_i ( {u_*,v_*})>0\) if

$$\begin{aligned} D_0 >0\,\quad \hbox {and}\quad -D_1 >0. \end{aligned}$$

\(D_0 >0\,\) and \(-D_1 >0\) if

$$\begin{aligned} \alpha _i =\frac{4d_i }{\pi \Delta _i}\quad \hbox {and}\quad \beta _i =\frac{4d_{i+1} }{\pi \Delta _i }, \quad \Delta _i \ne 0. \end{aligned}$$

All the above discussions can be summarized as follows:

Theorem 4

The piecewise \(GC^1\) quadratic trigonometric interpolant \(S_i ( x)\), defined over the interval \([{a,b}],\) in (4), is convex if the parameter \(\alpha _i \,\) and \(\beta _i\) in each subinterval \(I_i =[{x_i,x_{i+1}}]\) satisfy the following conditions:

$$\begin{aligned} \alpha _i =\frac{4d_i }{\pi \Delta _i }\quad \mathrm{and} \quad \beta _i =\frac{4d_{i+1} }{\pi \Delta _i }, \quad \Delta _i \ne 0. \end{aligned}$$

5 Numerical examples

In this section, the shape-preserving trigonometric schemes developed in Sect. 4 are implemented on some positive, monotone and convex data sets.

A positive data set is taken in Table 1. The positive data in Table 1 is interpolated in Figs. 1 and 2 by \(GC^1\) quadratic trigonometric function (4) for arbitrary values of free parameters \(( {\alpha _i =1, \beta _i =1.5}).\) It is clear from Fig. 2 that \(GC^1\) quadratic trigonometric function (4) fails to preserve the shape of positive data taken in Table 1 for arbitrary chosen values of parameters. The positive curve in Fig. 3 is produced by interpolating the same data by the positive curve interpolation scheme developed in Sect. 4.1.

Fig. 1
figure 1

Quadratic trigonometric curve and its control polygon

Fig. 2
figure 2

\(GC^1\) quadratic trigonometric functions \(( {\alpha _i =1, \beta _i =1.5})\)

Fig. 3
figure 3

Positive \(GC^1\) quadratic trigonometric functions

Table 1 A positive data set

Other positive data sets are taken in Tables 2 and 3. Figures 4 and 6 are produced by interpolating the positive data in Tables 2 and 3 for arbitrary values of parameters. The \(GC^1\) quadratic trigonometric function (4) does not preserve the shape of positive data in Figs. 4 and 6 for randomly chosen values of parameters. Positive curves in Figs. 5 and 7 are produced by interpolating the positive data of Tables 2 and 3 by the positive curve interpolation scheme developed in Sect. 4.1.

Table 2 A positive data set
Table 3 A positive data set
Fig. 4
figure 4

\(GC^1\) quadratic trigonometric functions \(( {\alpha _i =1,\beta _i =1.5})\)

Fig. 5
figure 5

Positive \(GC^1\) quadratic trigonometric functions

Fig. 6
figure 6

\(GC^1\) quadratic trigonometric functions \(( {\alpha _i =0.6,\beta _i =2.25})\)

Fig. 7
figure 7

Positive \(GC^1\) quadratic trigonometric functions

Three monotone data sets are taken in Tables 4, 5 and 6. The monotone data of Table 4 is interpolated by \(GC^1\) quadratic trigonometric function (4) in Fig. 8 for arbitrary values of parameters \(( {\alpha _i =0.5,\beta _i =5}).\) It is clear from Fig. 8 that \(GC^1\) quadratic trigonometric function (4) fails to preserve the shape of monotone data for randomly chosen parameters. The monotone curve in Fig. 9 is produced by interpolating the same data by the monotone curve interpolation scheme developed in Sect. 4.2. The monotone data sets of Tables 5 and 6 are interpolated in Figs. 10 and 12 by \(GC^1\) quadratic trigonometric function (4) for random values of parameters. It is clear from Figs. 10 and 12 that the trigonometric interpolant (4) does not preserve the monotone shape of the data. The monotone curves in Figs. 11 and 13 are produced by interpolating the monotone data of Tables 5 and 6 by the monotone curve interpolation scheme of Sect. 4.2. Hence, the monotone curve interpolation scheme developed in Sect. 4.2 preserves the shape of the monotone data.

Table 4 A monotone data set
Table 5 A monotone data set
Table 6 A monotone data set
Fig. 8
figure 8

\(GC^1\) quadratic trigonometric functions \(( {\alpha _i =0.5,\beta _i =5})\)

Fig. 9
figure 9

Monotone \(GC^1\) quadratic trigonometric functions

Fig. 10
figure 10

\(GC^1\) quadratic trigonometric functions \(( {\alpha _i =0.25,\beta _i =1.5})\)

Fig. 11
figure 11

Monotone \(GC^1\) quadratic trignometric functions

Fig. 12
figure 12

\(GC^1\) quadratic trigonometric functions \(( {\alpha _i =0.9,\beta _i =15})\)

Fig. 13
figure 13

Monotone \(GC^1\) quadratic trigonometric functions

The convex data sets are taken in Tables 7, 8 and 9. Figures 14, 16 and 18 are produced by interpolating the convex data in Tables 7, 8 and 9, respectively, by \(GC^1\) quadratic trigonometric functions (4) for arbitrary values of free parameters \(\alpha _i \) and \(\beta _i \). It is clear from these figures that \(GC^1\) quadratic trigonometric functions failed to preserve the shape of the convex data. The convex trigonometric curves in Figs. 15, 17 and 19 are drawn with the convex data in Tables 7, 8 and 9, respectively, using the convex curve interpolation scheme developed in Sect. 4.3.

Table 7 A convex data set
Table 8 A convex data set
Table 9 A convex data set
Fig. 14
figure 14

\(GC^1\) quadratic trigonometric functions \(( {\alpha _i =0.8,\beta _i =2.5})\)

Fig. 15
figure 15

Convex \(GC^1\) quadratic trigonometric functions

Fig. 16
figure 16

\(GC^1\) quadratic trigonometric functions \(( {\alpha _i =0.7,\beta _i =1})\)

Fig. 17
figure 17

Convex \(GC^1\) quadratic trigonometric functions

Fig. 18
figure 18

\(GC^1\) quadratic trigonometric functions \(( {\alpha _i =1,\beta _i =0.5})\)

Fig. 19
figure 19

Convex \(GC^1\) quadratic trigonometric functions

6 Conclusion

This paper gives an alternative approach to preserve the shape of data using a trigonometric interpolant. Constraints are derived on free parameters to preserve the shape of the data. The order of approximation of the proposed interpolant is \(O( {h_i^3 })\). The interpolated curves are unique for the given data and parameters. The degree of interpolant is identical for all data and the interpolant is equally fruitful for uniform as well as nonuniform data. The derivatives at the knots can be computed from any efficient numerical scheme. In the proposed schemes, the derivatives are calculated by arithmetic mean approximation techniques.