﻿ The Cubic Trigonometric Automatic Interpolation Spline
 IEEE/CAA Journal of Automatica Sinica  2018, Vol. 5 Issue(6): 1136-1141 PDF
The Cubic Trigonometric Automatic Interpolation Spline
Juncheng Li1, Laizhong Song2, Chengzhi Liu1
1. College of Mathematics and Finance, Hunan University of Humanities, Science and Technology, Loudi 417000, China;
2. College of Science, China Three Gorges University, Yichang 443002, China
Abstract: A class of cubic trigonometric interpolation spline curves with two parameters is presented in this paper. The spline curves can automatically interpolate the given data points and become C2 interpolation curves without solving equations system even if the interpolation conditions are fixed. Moreover, shape of the interpolation spline curves can be globally adjusted by the two parameters. By selecting proper values of the two parameters, the optimal interpolation spline curves can be obtained.
Key words: Automatic interpolation     interpolation spline     shape adjustment     trigonometric polynomial
Ⅰ. INTRODUCTION

In geometric modeling, curves are usually constructed on the basis of polynomials. Recently, trigonometric polynomials have received much attention within geometric modeling. Some examples are the trigonometric polynomial Bézier curves [1]-[4], the trigonometric polynomial B-spline curves [5]-[8], and the trigonometric Hermite spline curves [9], [10]. Those trigonometric polynomial curves not only inherit similarities of the corresponding classical polynomial curves, but also have better performance ability in different aspects.

It is well known that the spline interpolation has a wide range of applications in geometric modeling. However, when the traditional cubic splines are used to construct $C^{2}$ interpolation curves, a linear equation system usually needs to be solved. In order to solve this problem, Su and Tan [11] and Yan and Liang [12] constructed two automatic interpolation splines on the basis of trigonometric polynomials. The main characteristic of these two splines is that they can automatically interpolate the given data points without solving equation systems. There are some deficiencies in these two splines, however, the shape of the spline presented in [11] cannot be adjusted when the data points and auxiliary points are fixed. Although the spline presented in [12] can achieve shape adjustment when the data points and auxiliary points are fixed, it can only become $G^{2}$ interpolation curve. The main purpose of this paper is to present a class of cubic trigonometric automatic interpolation spline curves with two parameters. The proposed spline curves can achieve shape adjustment by altering values of the two parameters. Specifically, the proposed spline curves can automatically interpolate the given data points and be $C^{2}$ without solving equations system even if the interpolation conditions are fixed. Furthermore, the optimal automatic interpolation spline curves can be obtained by selecting proper values of the two parameters.

The rest of this paper is organized as follows. In Section Ⅱ, the cubic trigonometric automatic interpolation spline curves with two parameters are constructed, and properties of interpolation spline curves are discussed. In Section Ⅲ, a method for determining the optimal automatic interpolation spline curves is presented, and some examples are given. A short conclusion is given in Section Ⅳ.

Ⅱ. THE CUBIC TRIGONOMETRIC AUTOMATIC INTERPOLATION SPLINE CURVES A. The Basis Functions

Firstly, the cubic trigonometric spline basis functions with two parameters are defined as follows.

Definition 1: For $0\leq t\leq 1$ , $\alpha$ , $\beta \in \mathbb{R}$ , the following four functions about $t$ are defined as cubic trigonometric spline basis functions,

 \begin{align} \label{eq1} \begin{cases} f_{0} (t)=\dfrac{1}{24}((-14\alpha -2\beta +6)+(9\alpha +3\beta -9)S+24\alpha S^{2}\\[1mm] \qquad\quad~ +(-19\alpha -\beta +3)S^{3}+(14\alpha +2\beta -6)C^{3} ) \\[3mm] f_{1} (t)=\dfrac{1}{24}((2\alpha -10\beta +6)+(-9\alpha -3\beta +9)C+24\beta S^{2}\\[1mm] \qquad\quad~+(-2\alpha -14\beta -6)S^{3}+(7\alpha +13\beta +9)C^{3} ) \\[3mm] f_{2} (t)=\dfrac{1}{24}((2\alpha +14\beta +6)+(-9\alpha -3\beta +9)S-24\beta S^{2}\\[1mm] \qquad\quad~+(7\alpha +13\beta +9)S^{3}+(-2\alpha -14\beta -6)C^{3} ) \\[3mm] f_{3} (t)=\dfrac{1}{24}((10\alpha -2\beta +6)+(9\alpha +3\beta -9)C-24\alpha S^{2}\\[1mm] \qquad\quad~+(14\alpha +2\beta -6)S^{3}+(-19\alpha -\beta +3)C^{3} ) \end{cases} \end{align} (1)

where $S: =\sin \dfrac{\pi} {2}t$ , $C: =\cos \dfrac{\pi} {2}t$ .

By simple deduction, the cubic trigonometric spline basis functions defined as (1) have the following properties at the endpoints,

 $\begin{cases} {f_{0} (0)=0, } ~~ {f_{1} (0)=1, } ~~ {f_{2} (0)=0, } ~~ {f_{3} (0)=0} \\ {f_{0} (1)=0, } ~~ {f_{1} (1)=0, } ~~ {f_{2} (1)=1, } ~~ {f_{3} (1)=0} \\ \end{cases}$ (2)
 $\begin{cases} {{f}'_{0} (0)=-\dfrac{\pi} {16}\left({-3\alpha -\beta +3} \right), } ~~ {{f}'_{1} (0)=0} \\[7pt] {{f}'_{2} (0)=\dfrac{\pi} {16}\left({-3\alpha -\beta +3} \right), } ~~ {{f}'_{3} (0)=0} \\[7pt] {{f}'_{0} (1)=0, } ~~ {{f}'_{1} (1)=-\dfrac{\pi} {16}\left({-3\alpha -\beta +3} \right)} \\[7pt] {{f}'_{2} (1)=0, } ~~ {{f}'_{3} (1)=\dfrac{\pi} {16}\left({-3\alpha -\beta +3} \right)} \\ \end{cases}$ (3)
 $\begin{cases} {{f}''_{0} (0)=\dfrac{\pi^{2}}{16}\left({\alpha -\beta +3} \right), } ~~ {{f}''_{1} (0)=-\dfrac{\pi^{2}}{8}\left({\alpha -\beta +3} \right)} \\[7pt] {{f}''_{2} (0)=\dfrac{\pi^{2}}{16}\left({\alpha -\beta +3} \right), } ~~ {{f}''_{3} (0)=0} \\[7pt] {{f}''_{0} (1)=0, } ~~ {{f}''_{1} (0)=\dfrac{\pi^{2}}{16}\left( {\alpha -\beta +3} \right)} \\[7pt] {{f}''_{2} (0)=-\dfrac{\pi ^{2}}{8}\left({\alpha -\beta +3} \right), } ~~ {{f}''_{3} (0)=\dfrac{\pi^{2}}{16}\left({\alpha -\beta +3} \right)}. \\ \end{cases}$ (4)

From (1), the cubic trigonometric spline basis functions have two free parameters $\alpha$ and $\beta$ . Hence, various shapes of curves of the cubic trigonometric spline basis functions can be obtained by altering values of the parameters $\alpha$ and $\beta$ . Fig. 1 shows curves of the cubic trigonometric spline basis functions for different values of $\alpha$ and $\beta$ , where $\alpha$ and $\beta$ are taken as $(\alpha,$ $\beta )$ $=$ $(-0.5, 0.5)$ (marked with dotted lines), $(\alpha, \beta)$ $=$ $(0,$ $0)$ (marked with solid lines), $(\alpha, \beta)=(0.5, -0.5)$ (marked with dashed lines).

 Download: larger image Fig. 1 Curves of the proposed basis functions for different $\alpha$ and $\beta$ .
B. Definition and Properties of the CTAI-spline Curves

Depending on the cubic trigonometric spline basis functions, the cubic trigonometric automatic interpolation spline curves with two parameters can be defined as follows.

Definition 2: Given a series of data points $(x_{i}, y_{i} )$ $(i=$ $0, 1, \ldots, n)$ , set $h_{i} =x_{i+1} -x_{i}$ $(i=0, 1, \ldots, n-1)$ , the following piecewise curves are called cubic trigonometric automatic interpolation spline curves (CTAI-spline curves for short),

 \begin{align} \label{eq5} S_{i} (x)=&\ f_{0} \left({\frac{x-x_{i}} {h_{i}}} \right)y_{i-1} +f_{1} \left({\frac{x-x_{i}} {h_{i}}} \right)y_{i} \nonumber\\[2mm] & +f_{2} \left({\frac{x-x_{i} }{h_{i}}} \right)y_{i+1} +f_{3} \left({\frac{x-x_{i}} {h_{i}}} \right)y_{i+2} \end{align} (5)

where $x\in [x_{i}, x_{i+1}]$ $(i=1, 2, \ldots, n-2)$ , $f_{j} ( {\dfrac{x-x_{i}} {h_{i}}} )$ $(j=$ $0, 1, 2, 3)$ are the cubic trigonometric spline basis functions defined according to (1).

Theorem 1: The CTAI-spline curves defined as (5) have the following properties,

a) Automatic interpolation property: For given data points $(x_{i}, y_{i})$ $(i=0, 1, \ldots, n)$ , the CTAI-spline curves $S_{i} (x)$ $(i=$ $1, 2, \ldots, n-2)$ automatically interpolate all the given data points except $(x_{0}, y_{0})$ and $(x_{n}, y_{n})$ , i.e.,

 \begin{align*} \begin{cases} S_{i} (x_{i})=y_{i} \\[1mm] S_{i} (x_{i+1})=y_{i+1} \\ \end{cases}, \quad i=1, 2, \ldots, n-2. \end{align*}

b) $C^{2}$ continuity: When $h_{i}$ $(i=0, 1, \ldots, n-1)$ are equal to a constant $h$ , the CTAI-spline curves $S_{i} (x)$ $(i=1, 2, \ldots,$ $n-2)$ are $C^{2}$ , i.e.,

 \begin{align*} S_{i}^{(k)} (x_{i+1})=S_{i+1}^{(k)} (x_{i+1}), \quad k=0, 1, 2;~ i=1, 2, \ldots, n-3. \end{align*}

Proof: a) By (2) and (5), we have

 \begin{align} \label{eq6} \begin{cases} S_{i} (x_{i})=f_{0} (0)y_{i-1} +f_{1} (0)y_{i} +f_{2} (0)y_{i+1} +f_{3} (0)y_{i+2} \\ \qquad~~=y_{i} \\[2mm] S_{i} (x_{i+1})=f_{0} (1)y_{i-1} +f_{1} (1)y_{i} +f_{2} (1)y_{i+1} +f_{3} (1)y_{i+2} \\ \qquad\quad~~=y_{i+1} \\ \end{cases} \end{align} (6)

Equation (6) shows that the CTAI-spline curves $S_{i} (x)$ $(i=$ $1, 2, \ldots, n-2)$ automatically interpolate all the given data points except $(x_{0}, y_{0})$ and $(x_{n}, y_{n})$ .

b) When $h_{i}$ $(i=0, 1, \ldots, n-1)$ are equal to a constant $h$ , by (3) and (5), we have

 \begin{align} \label{eq7} \begin{cases} {S}'_{i} (x_{i})=\dfrac{1}{h}\left({{f}'_{0} (0)y_{i-1} {+}{f}'_{1} (0)y_{i} +{f}'_{2} (0)y_{i{+}1} {+}{f}'_{3} (0)y_{i{+}2}} \right)\\[3mm] \qquad~~=\dfrac{\pi }{16h}(-3\alpha -\beta +3)~(y_{i+1} -y_{i-1}) \\[5mm] {S}'_{i} (x_{i{+}1})=\dfrac{1}{h}\left({{f}'_{0} (1)y_{i-1} {+}{f}'_{1} (1)y_{i} {+}{f}'_{2} (1)y_{i{+}1} {+}{f}'_{3} (1)y_{i{+}2}} \right)\\[3mm] \qquad\quad~~=\dfrac{\pi }{16h}(-3\alpha -\beta +3)~(y_{i+2} -y_{i}). \end{cases} \end{align} (7)

By (4) and (5), we have

 \begin{align} \label{eq8} ~~~~~~~\begin{cases} {S}''_{i} (x_{i})=\dfrac{1}{h^{2}}({f}''_{0} (0)y_{i-1} +{f}''_{1} (0)y_{i} +{f}''_{2} (0)y_{i+1} \\ \qquad\quad~~~+{f}''_{3} (0)y_{i+2} )=\dfrac{\pi ^{2}}{16h^{2}}(\alpha -\beta +3)\\ \qquad\quad~~~~(y_{i-1} -2y_{i} +y_{i+1}) \\[3mm] {S}''_{i} (x_{i+1})=\dfrac{1}{h^{2}}({f}''_{0} (1)y_{i-1} +{f}''_{1} (1)y_{i} +{f}''_{2} (1)y_{i+1} \\ \qquad\qquad~~~+{f}''_{3} (1)y_{i+2} )=\dfrac{\pi ^{2}}{16h^{2}}(\alpha -\beta +3)\\ \qquad\qquad~~~~(y_{i} -2y_{i+1} +y_{i+2}). \end{cases} \end{align} (8)

From (6)-(8), we have

 \begin{align} \label{eq9} &\begin{cases} S_{i} (x_{i+1})=y_{i+1} =S_{i+1} (x_{i+1}) \\[2mm] {S}'_{i} (x_{i+1})=\dfrac{\pi} {16h}(-3\alpha -\beta +3)(y_{i+2} -y_{i} )\\[5pt] \qquad\qquad={S}'_{i+1} (x_{i+1}) \\[2mm] {S}''_{i} (x_{i+1})=\dfrac{\pi^{2}}{16h^{2}}(\alpha -\beta +3)(y_{i} -2y_{i+1} +y_{i+2})\\[5pt] \qquad\qquad\, ={S}''_{i+1} (x_{i+1}) \\ \end{cases}, \nonumber\\ &\qquad\qquad\qquad\qquad\qquad\qquad\qquad\ \ i=1, 2, \ldots, n-3. \end{align} (9)

Equation (9) shows that the CTAI-spline curves $S_{i} (x)$ $(i=$ $1, 2, \ldots, n-2)$ are $C^{2}$ .

From Theorem 1, if two auxiliary points $(x_{-1}, y_{-1})$ and $(x_{n+1}, y_{n+1})$ are added to the given data points, the CTAI-spline curves $S_{i} (x)$ $(i=0, 1, \ldots, n-1)$ interpolating all the data points $(x_{i}, y_{i})$ $(i=0, 1, \ldots, n)$ would be naturally obtained. The two auxiliary points can be added arbitrarily, and they only have effects on the starting and the end segments of the interpolation curves. For convenience, $(x_{-1}, y_{-1})$ and $(x_{n+1},$ $y_{n+1})$ can be taken as

 \begin{align} \label{eq10} \begin{cases} (x_{ - 1} , y_{ - 1} ) = 2(x_0 , y_0 ) - (x_1 , y_1 ) \\[1mm] (x_{n + 1} , y_{n + 1} ) = 2(x_n , y_n ) - (x_{n - 1} , y_{n - 1} ). \end{cases} \end{align} (10)

It is clear that there exist two degree of freedom in the CTAI-spline curves, even if the data points and auxiliary points are fixed. Different shapes of the interpolation curves can be obtained by altering the parameters $\alpha$ and $\beta$ .

Example 1: Given data points

 \begin{align*} &(x_{0}, y_{0})=(-1, -2), ~ (x_{1}, y_{1})=(0, 1)\\[1mm] &(x_{2}, y_{2})=(1, 3), ~ (x_{3}, y_{3})=(2, 4), ~ (x_{4}, y_{4})=(3, 2) \end{align*}

and two auxiliary points $(x_{-1}, y_{-1})$ , $(x_{5}, y_{5})$ are added to the data points according to (10). Then, the $C^{2}$ CTAI-spline curves with different values of parameters $\alpha$ and $\beta$ are shown in Fig. 2, where the parameters are taken as $(\alpha, \beta)=(1, -1)$ (marked with dotted lines), $(\alpha, \beta)=(0, 0)$ (marked with solid lines), $(\alpha, \beta)=(-1, 1)$ (marked with dashed lines).

 Download: larger image Fig. 2 Different shapes of the $C^{2}$ CTAI-spline curves for data points.

Example 2: Given a function $y=r(x)={1}/{(1+x^{2})}$ $(-5$ $\leq$ $x\leq 5)$ , set $x_{i} =-5+i$ , $y_{i} =r(x_{i})$ $(i=0, 1, \ldots, 10)$ , and two auxiliary points $(x_{-1}, y_{-1})$ and $(x_{11}, y_{11})$ are added to the data points according to (10). Then, the curve of the given function (marked with solid lines) and the $C^{2}$ CTAI-spline curves with different values of parameters $\alpha$ and $\beta$ are shown in Fig. 3, where the parameters are taken as $(\alpha, \beta)=(-1, 1)$ (marked with dotted lines), $(\alpha, \beta)=(1, -1)$ (marked with dashed lines).

 Download: larger image Fig. 3 Different shapes of the $C^{2}$ CTAI-spline curves for a function.

Example 3: Given proper data points and added two auxiliary points, some special curves generated by the $G^{2}$ CTAI-spline curves can be obtained. The shape of the curves also can be adjusted by altering values of the parameters $\alpha$ and $\beta$ , see in Figs. 4 and 5.

 Download: larger image Fig. 4 The note-like curves generated by the CTAI-spline curves.
 Download: larger image Fig. 5 The vane-like curves generated by the CTAI-spline curves.

Remark 1: When the traditional cubic polynomial splines are used to construct $C^{2}$ interpolation curves, the general way is to reverse the linear equations system. However, due to the automatic interpolation property and continuity of the CTAI-spline, the $C^{2}$ interpolation curves can be naturally obtained without solving a system of equations. On the other hand, when the data points and auxiliary points are fixed, the traditional cubic polynomial spline interpolation curves are unique, while shapes of the CTAI-spline curves can be adjusted by altering values of the parameters $\alpha$ and $\beta$ .

Remark 2: On one hand, compared with some trigonometric spline curves (such as [6]-[8]), the main characteristic of the CTAI-spline curves is that they can automatically interpolate the given data points without solving systems of equations. On the other hand, compared with the two trigonometric automatic interpolation splines presented in [11] and [12], the CTAI-spline has the following characteristics,

a) The shape of the trigonometric automatic interpolation spline presented in [11] is unique when the data points and auxiliary points are fixed, while the CTAI-spline curves can achieve shape adjustment by parameters $\alpha$ and $\beta$ , even if the data points and auxiliary points are unchanged.

b) Although the shape of the trigonometric automatic interpolation spline presented in [12] can be adjusted when the data points and auxiliary points are fixed, the interpolation curves are only $G^{2}$ . However, the CTAI-spline curves are not only adjustable in shape, but also can become $C^{2}$ interpolation curves.

Ⅲ. THE OPTIMAL CTAI-SPLINE CURVES

As mentioned above, suppose a function $y=r(x)$ $(x_{0} \leq x$ $\leq$ $x_{n})$ , set $x_{i} =x_{0} +hi$ $(h>0)$ , $y_{i} = r(x_{i})$ $(i=0, 1, \ldots, n)$ , and two auxiliary points $(x_{-1}, y_{-1})$ , $(x_{n+1},$ $y_{n+1})$ are added to the data points according to (10), the corresponding $C^{2}$ CTAI-spline curves would be completely determined by the parameters $\alpha$ and $\beta$ . Hence, bad interpolation curves would be generated if the parameters $\alpha$ and $\beta$ are chosen improperly.

Example 4: Given a function $y=r(x)={(\sin x)}/{x}$ $(1\leq x$ $\leq$ $5)$ , set $x_{i} =1+{i}/{2}$ , $y_{i} =r(x_{i})$ $(i=0, 1, \ldots, 8)$ , and two auxiliary points $(x_{-1}, y_{-1})$ and $(x_{9}, y_{9})$ are added to the data points according to (10). Fig. 6 shows the curve of the given function (marked with dotted lines) and the $C^{2}$ CTAI-spline curves with different values of parameters $\alpha$ and $\beta$ .

 Download: larger image Fig. 6 Effects of the parameters on the $C^{2}$ CTAI-spline curves.

It is obvious that the interpolation curves in Fig. 3(a) are more satisfactory than the curves in Fig. 3(b). Hence, how to determine proper values of the parameters $\alpha$ and $\beta$ is of great importance when constructing the $C^{2}$ CTAI-spline curves. A method for determining values of the parameters $\alpha$ and $\beta$ is presented as follows.

Let

 \begin{align} \label{eq11} F(\alpha, \beta)=\sum\limits_{i=0}^{n-1} {\int_{x_{i}} ^{x_{i+1}} {\left( {S_{i} (x)-r(x)} \right)^{2}} {d}x} \end{align} (11)

where $\alpha$ , $\beta \in \mathbb{R}$ , $S_{i} (x)$ is the corresponding CTAI-spline curves defined in the interval $[x_{i}, x_{i+1}]$ $(i=0, 1, 2, \ldots, n-1)$ .

In order to obtain the minimum interpolation error, we have

 \begin{align} \label{eq12} \begin{cases} \dfrac{\partial F(\alpha, \beta)}{\partial \alpha} =0 \\[3mm] \dfrac{\partial F(\alpha, \beta)}{\partial \beta} =0 .\\ \end{cases} \end{align} (12)

Set

 \begin{align*} &M_{01} (x)=\frac{1}{24}({-14+9S+24S^{2}-19S^{3}+14C^{3}} )\\[1mm] &M_{02} (x)=\frac{1}{24}({-2+3S-S^{3}+2C^{3}} )\\[1mm] &M_{03} (x)=\frac{1}{24}({6-9S+3S^{3}-6C^{3}} )\\[1mm] &M_{11} (x)=\frac{1}{24}({2-9C-2S^{3}+7C^{3}} )\\[1mm] &M_{12} (x)=\frac{1}{24}({-10-3C+24S^{2}-14S^{3}+13C^{3}} )\\[1mm] &M_{13} (x)=\frac{1}{24}({6+9C-6S^{3}+9C^{3}} )\\[1mm] &M_{21} (x)=\frac{1}{24}({2-9S+7S^{3}-2C^{3}} )\\[1mm] &M_{22} (x)=\frac{1}{24}({14-3S-24S^{2}+13S^{3}-14C^{3}} )\\[1mm] &M_{23} (x)=\frac{1}{24}({6+9S+9S^{3}-6C^{3}} )\\[1mm] &M_{31} (x)=\frac{1}{24}({10+9C-24S^{2}+14S^{3}-19C^{3}} )\\[1mm] &M_{32} (x)=\frac{1}{24}({-2+3C+2S^{3}-C^{3}} )\\[1mm] &M_{33} (x)=\frac{1}{24}({6-9C-6S^{3}+3C^{3}} ) \end{align*}

where $S: =\sin \dfrac{\pi} {2}t$ , $C: =\cos \dfrac{\pi} {2}t$ , $t=\dfrac{x-x_{i} }{h}$ , $h=x_{i+1} -x_{i}$ .

Then, (5) can be rewritten as follows:

 \begin{align} \label{eq13} S_{i} (x)=L_{1} (x)\alpha +L_{2} (x)\beta +L_{3} (x) \end{align} (13)

where

 \begin{align*} L_{1} (x)=&\ M_{01} (x)y_{i-1} +M_{11} (x)y_{i} +M_{21} (x)y_{i+1} \\ &\, +M_{31} (x)y_{i+2}\\[1mm] L_{2} (x)=&\ M_{02} (x)y_{i-1} +M_{12} (x)y_{i} +M_{22} (x)y_{i+1} \\ &\, +M_{32} (x)y_{i+2}\\[1mm] L_{3} (x)=&\ M_{03} (x)y_{i-1} +M_{13} (x)y_{i} +M_{23} (x)y_{i+1} \\ &\, +M_{33} (x)y_{i+2}. \end{align*}

By (13), (11) can be rewritten as follows:

 \begin{align} \label{eq14} F(\alpha, \beta)=&\ \sum\limits_{i=0}^{n-1} {\int_{x_{i}} ^{x_{i+1}} {S_{i}^{2} (x)} {d}x} -2\sum\limits_{i=0}^{n-1} {\int_{x_{i}} ^{x_{i+1} } {S_{i} (x)} r{\rm (}x{)d}x} \nonumber\\ &\ +\sum\limits_{i=0}^{n-1} {\int_{x_{i} }^{x_{i+1}} {r^{2}(x)} {d}x}\nonumber\\[2mm] =&\ C_{1} \alpha^{2}+C_{2} \beta^{2}+2C_{3} \alpha \beta +2C_{4} \alpha +2C_{5} \beta +C_{6} \end{align} (14)

where

 \begin{align*} &C_{1} =\sum\limits_{i=0}^{n-1} {\int_{x_{i}} ^{x_{i+1}} {L_{1}^{2} (x)} {d}x}\\ &C_{2} =\sum\limits_{i=0}^{n-1} {\int_{x_{i}} ^{x_{i+1}} {L_{2}^{2} (x)} {d}x}\\ &C_{3} =\sum\limits_{i=0}^{n-1} {\int_{x_{i}} ^{x_{i+1}} {L_{1} (x)L_{2} (x)} {d}x}\\ &C_{4} =\sum\limits_{i=0}^{n-1} {\int_{x_{i}} ^{x_{i+1}} {L_{1} (x)\left( {L_{3} (x)-r(x)} \right)} {d}x}\\ &C_{5} =\sum\limits_{i=0}^{n-1} {\int_{x_{i}} ^{x_{i+1}} {L_{2} (x)\left( {L_{3} (x)-r(x)} \right)} {d}x}\\ &C_{6} =\sum\limits_{i=0}^{n-1} {\int_{x_{i}} ^{x_{i+1}} {\left({L_{3} (x)-r(x)} \right)^{2}} {d}x}. \end{align*}

From (14), (12) can be rewritten as follows:

 \begin{align} \label{eq15} \begin{cases} C_{1} \alpha +C_{3} \beta +C_{4} =0 \\[1mm] C_{3} \alpha +C_{2} \beta +C_{5} =0. \end{cases} \end{align} (15)

If $C_{1} C_{2} -C_{3}^{2} \ne 0$ , we have

 \begin{align} \label{eq16} \begin{cases} \alpha =\dfrac{C_{3} C_{5} -C_{2} C_{4}} {C_{1} C_{2} -C_{3}^{2}} \\[4mm] \beta =\dfrac{C_{3} C_{4} -C_{1} C_{5}} {C_{1} C_{2} -C_{3}^{2}}. \end{cases} \end{align} (16)

Remark 3: If $C_{1} C_{2} -C_{3}^{2} =0$ , then (15) has no unique solution. In this case, the data points could be changed to guarantee that $C_{1} C_{2} -C_{3}^{2} \ne 0$ .

After the optimal parameters $\alpha$ and $\beta$ are calculated from (16), the optimal $C^{2}$ CTAI-spline curves $S_{i} (x)$ $(i =0, 1,$ $\ldots,$ $n-1)$ interpolating the given function $y=r(x)$ can be obtained.

Since the trigonometric automatic interpolation spline curves presented by [11] are $C^{2}$ , and the trigonometric automatic interpolation spline curves presented by [12] are $G^{2}$ , so, the spline curves presented by [11] are chosen to compare with the optimal $C^{2}$ CTAI-spline curves in the following two examples.

Example 5: Given a function $y=r(x)= {1}/{(1+x^{2})}$ $(-5\leq$ $x$ $\leq 5)$ , set $x_{i} =-5+\dfrac{10}{n}i$ , $y_{i} =r(x_{i})$ $(i=0, 1, \ldots, n)$ , and two auxiliary points $(x_{-1}, y_{-1})$ and $(x_{n+1}, y_{n+1})$ are added to the data points according to (10). For different $n$ (where $n+1$ is the number of the data points), the optimal parameters of the $C^{2}$ CTAI-spline curves are calculated from (16). Interpolation errors of the optimal CTAI-spline curves and the spline curves presented by [11] are shown in Table Ⅰ.

Table Ⅰ
INTERPOLATION RESULTS FOR DIFFERENT $n$ OF EXAMPLE 5

The curve of the given function (marked with solid lines), the optimal $C^{2}$ CTAI-spline curves ( $n=10$ , marked with dotted lines) and the spline curves presented by [11] ( $n=10$ , marked with dashed lines) are shown in Fig. 7. To facilitate observation, the curve of the given function is increased by 0.1 units and the spline curves presented by [11] are increased 0.2 units in Fig. 7.

 Download: larger image Fig. 7 Interpolation results of Example 5 ( $n= 10$ ).

Example 6: Given a function $y=r(x)={(\sin x)}/{x}$ $(1 \leq$ $x$ $\leq$ $5)$ , set $x_{i} =1+\dfrac{4}{n}i$ , $y_{i} =r(x_{i})$ $(i=0, 1, \ldots, n)$ , and two auxiliary points $(x_{-1}, y_{-1})$ and $(x_{n+1}, y_{n+1})$ are added to the data points according to (10). For different $n$ (where $n+ 1$ is the number of the data points), the optimal parameters of the $C^{2}$ CTAI-spline curves are calculated from (16). Interpolation errors of the optimal CTAI-spline curves and the spline curves presented by [11] are shown in Table Ⅱ.

Table Ⅱ
INTERPOLATION RESULTS FOR DIFFERENT $n$ OF EXAMPLE 6

The curve of the given function (marked with solid lines), the optimal $C^{2}$ CTAI-spline curves ( $n=8$ , marked with dotted lines), and the spline curves presented by [11] ( $n=8$ , marked with dashed lines) are shown in Fig. 8. To facilitate observation, the curve of the given function is increased 0.1 units and the spline curves presented by [11] are increased 0.2 units in Fig. 8.

 Download: larger image Fig. 8 Interpolation results of Example 6 ( $n=$ 8).

Example 5 and Example 6 show that the interpolation result of the optimal $C^{2}$ CTAI-spline curves is better than the trigonometric automatic interpolation spline curves presented by [11], which is due to the parameters $\alpha$ and $\beta$ of the CTAI-spline curves observing their optimal values.

Ⅳ. CONCLUSIONS

A class of cubic trigonometric automatic interpolation spline curves with two parameters is presented in this paper. The spline curves can not only automatically interpolate the given data points and be $C^{2}$ without solving a system of equations, but can also achieve shape adjustment by altering values of the two parameters, even when the interpolation conditions are fixed. The examples illustrate the feasibility of this method. Furthermore, cubic trigonometric automatic interpolation spline surfaces with shape parameters can be constructed, and they enjoy the same characteristics as the interpolation spline curves. The corresponding parametric spline curves and surfaces are discussed as well.

REFERENCES
 [1] X. A. Han, Y. C. Ma, and X. L. Huang, "The cubic trigonometric Bézier curve with two shape parameters, " Appl. Math. Lett., vol. 22, no. 2, pp. 226-231, Feb. 2009. http://www.sciencedirect.com/science/article/pii/S0893965908001262 [2] U. Bashir, M. Abbsa, and J. M. Ali, "The G2 and C2 rational quadratic trigonometric Bézier curve with two shape parameters with applications, " Appl. Math. Comput., vol. 219, no. 20, pp. 10183-10197, Jun. 2013. http://www.ams.org/mathscinet-getitem?mr=3056720 [3] X. L. Han, "Normalized B-basis of the space of trigonometric polynomials and curve design, " Appl. Math. Comput., vol. 215, pp. 336-348, Jan. 2015. http://www.sciencedirect.com/science/article/pii/S0096300314016026 [4] U. Bashir and J. M. Ali, "Rational cubic trigonometric Bézier curve with two shape parameters, " Comput. Appl. Math., vol. 35, no. 1, pp. 285-300, Apr. 2016. https://link.springer.com/article/10.1007/s40314-014-0194-z [5] M. Dube and R. Sharma, "Quadratic NUAT B-spline curves with multiple shape parameters, " Int. J. Mach. Intell., vol. 3, no. 1, pp. 18-24, Jun. 2011. http://connection.ebscohost.com/c/articles/65528057/quadratic-nuat-b-spline-curves-multiple-shape-parameters [6] X. L. Han and Y. P. Zhu, "Curve construction based on five trigonometric blending functions, " BIT Numer. Math., vol. 52, no. 4, pp. 953-979, Dec. 2012. https://link.springer.com/article/10.1007%2Fs10543-012-0386-0 [7] C. Bracco, D. Berdinsky, D. Cho, M. Oh, and T. Kim, "Trigonometric generalized T-splines, " Comput. Methods Appl. Mech. Eng., vol. 268, pp. 540-556, Jan. 2014. http://www.sciencedirect.com/science/article/pii/S0045782513002429 [8] L. L. Yan, "Cubic trigonometric nonuniform spline curves and surfaces, " Math. Probl. Eng., vol. 2016, Article No. 7067408, Jan. 2016. http://dx.doi.org/10.1155/2016/7067408 [9] J. Y. Du, H. L. Han, and G. X. Jin, "On trigonometric and paratrigonometric Hermite interpolation, " J. Approxim. Theory, vol. 131, no. 1, pp. 74-99, Nov. 2004. http://www.sciencedirect.com/science/article/pii/S0021904504001510 [10] X. L. Han, "Piecewise trigonometric Hermite interpolation, " Appl. Math. Comput., vol. 268, pp. 616-627, Oct. 2015. http://www.sciencedirect.com/science/article/pii/S0096300315009091 [11] B. Y. Su and J. Q. Tan, "A family of quasi-cubic blended splines and applications, " J. Zhejiang Univ. Sci. A, vol. 7, no. 9, pp. 1550-1560, Sep. 2006. http://kns.cnki.net/KCMS/detail/detail.aspx?filename=ZDYG200609014&dbname=CJFD&dbcode=CJFQ [12] L. L. Yan and J. F. Liang, "A class of algebraic-trigonometric blended splines, " J. Comput. Appl. Math., vol. 235, no. 6, pp. 1713-1729, Jan. 2011. https://www.deepdyve.com/lp/elsevier/a-class-of-algebraic-trigonometric-blended-splines-Ig8d5JeTge