APPLICATION OF PIECEWISE-CUBIC FUNCTIONS FOR CONSTRUCTING A BEZIER TYPE CURVE OF C 1 SMOOTHNESS

Interpolation and approximation of numerical sets of data is a relevant task in applied mathematics because of a widespread application in various fields of science and technology. Among the various areas of research, there are two that stand out ‒ the interpolation using polynomial splines, which solves a problem on the construction of curves that pass through the set points, and methods for constructing Bezier curves for which set points are the control points. It is understood in the sense that a curve does not pass through these points but approaches them, changing in so doing its shape depending on their location. At present, researchers chose to combine these two approaches. That makes it possible to obtain rather smooth curves and efficient algorithms for their construction with the possibility of interactive control over the shape of the curves using control points. 2. Literature review and problem statement


Introduction
Interpolation and approximation of numerical sets of data is a relevant task in applied mathematics because of a widespread application in various fields of science and technology.Among the various areas of research, there are two that stand outthe interpolation using polynomial splines, which solves a problem on the construction of curves that pass through the set points, and methods for constructing Bezier curves for which set points are the control points.It is understood in the sense that a curve does not pass through these points but approaches them, changing in so doing its shape depending on their location.At present, researchers chose to combine these two approaches.That makes it possible to obtain rather smooth curves and efficient algorithms for their construction with the possibility of interactive control over the shape of the curves using control points.

Literature review and problem statement
A method for constructing curves, which are called the Bezier curves, was developed independently by engineers Pierre Bézier, who worked for the automotive company Renault (Headquarters in the city of Boulogne-Billancourt, France), and Paul de Castillo, who was an employee of the automobile company Citroën (Headquarters in Paris, France) [1].They proposed to apply these curves to design automobile bodies.A widespread use of Bezier curves for the problems on approximation is associated with convenience in both the analytical description and the visual geometrical construction.Employing the Bezier curves in computer graphics systems allows the user to move control points using a cursor on the screen to interactively change the shape of the curve [2].This is a handy tool used in various areas of technical design.
A detailed description of Bezier curves with many examples is given in paper [4].Article [5] proposes a new approach to building the Bezier curves with a preset smoothness.To overcome these constraints, the B-splines are employed [6].The built curve resides inside the convex shell of the defining polygon.
The combination of Bezier curves with a procedure for building a spline yielded significant possibilities to the development of spline curves.A comparison between the Bezier curve and methods for interpolation using the Hermitian splines is given in paper [7].Manipulating control points makes it possible to customize the interpolation spline to the shape of the curve selected by a designer.Paper [8] studied the criteria for choosing the "best" spline to achieve a G 2 -smoothness of the entire curve.The structure of spline is introduced with additional parameters for retaining the universality and good approximating properties of splines in terms of engineering applications.
Paper [9] presented techniques for obtaining piecewise-quadratic polynomial curves with four control points for each segment of the curve and local parameters of the shape.Introducing additional parameters to the basis is a convenient way to adjust shape of the curves.Numerical and geometrical effects caused by a change in the shape parameters are investigated in [10].[11] shows the way the shape of the curve changes locally depending on values for the parameters of the shape, which are included in the basis.
In order to represent conical curves, as well as certain transcendental curves, it is more appropriate to use trigonometric functions as the basis functions of the B-spline curve.In this case, the introduction of parameters to basis functions also provides additional possibilities to adjust the shape of the curve.Authors of [12] employ a trigonometric basis that contains parameters of the shape to represent an ellipse.Article [13] reported building a new type of splines, which are called quadratic irregular algebraic trigonometric B-splines with several shape parameters, and which make it possible to globally or locally adjust the shape of the curves.Paper [14] studied the dependence of geometrical properties of the proposed cubic trigonometric curves and the Bezier surfaces on the shape parameters.Authors of [15] also considered cubic trigonometric basis functions of a spline with a local parameter of the shape.Thus, the introduction of parameters makes it possible to build a class of functions among which one can choose the one that is most suitable for a given data set.
At the same time, the inclusion of shape parameters into a basis, although allows a local change in the shape of the curve, however, has its drawbacks.The popularity of the idea of Bezier curves is explained by that using control points the user can interactively choose the shape of the curve, while introduction of parameters to the basis does not provide for such an opportunity.The smoothness of the curve can also depend on the values of parameters.Thus, for example, authors in [11] achieve, at the points where individual segments of the curve are joined, in the general case, only a smoothness of G 1 , while a smoothness of С 1 is displayed by the curve only when parameters accept zero values.
Paper [16] outlines methods that are used in computer graphics.Specifically, it describes the OpenGL software package, which is widely applied currently in most computer systems.The package has features that make it possible to work effectively with the Bezier splines, B-splines, and other spline curves.[17] deals with the use of curves and surfaces in geometrical modeling, the algorithmic processing of Bezier curves and spline curves is also considered.A mathematical theory of the basic methods of computer graphics is generalized in [18]; the authors examined the application of Bezier splines, B-splines, and generalized cubic splines for the systems of computer graphics.Methods for modeling curves and surfaces, used in the related fields of geometric modeling, computer geometric design and computer graphics, are described in [19].
Thus, it is a promising task to develop efficient algorithms for constructing piecewise-polynomial curves with smoothness С 1 with an interactive possibility to change the shape of the curve using control points and shape parameters of the curve.

The aim and objectives of the study
The aim of present study is to develop and substantiate, by using piecewise-cubic polynomials, a method for constructing a spline curve, which would retain such important properties of Bezier curves as the inheritance of the shape, which is assigned by control points, the possibility of interactive control over the shape of the curve by using these points and a local control over the shape of the curve applying shape parameters at total smoothness С 1 .This would make it possible to extend the functional toolset of computer graphics systems in terms of interactive influence, including local, on the shape of the curve.
To accomplish the aim, the following tasks have been set: -to build a system of equations to calculate coefficients of the curve with preset properties; -to find conditions for the existence and uniqueness of the curve to be built; -to illustrate, drawing examples, the approximating properties of the built curve and the possibility for a local change in its shape depending on parameters.

Method for constructing a curve and conditions for its existence and uniqueness
In order to develop a method for constructing a spline curve with preset properties, we shall employ the approach that was developed for the construction of a parabolic spline [20] and further developed for non-uniform grids [21].
Let us consider a certain interval [a, b] in which we determine partitioning : ... .

N a b
In knots τ i , we set the value F i (control points).Along with partitioning Δ τ , we introduce partitioning where τ i-1 <x i <τ i , i=2,..., N. Values of a certain function at points x i are denoted by f i .
We introduce notation With respect to these notations, we obtain: ) .
We shall build a spline curve of third degree S(x), a≤x≤b, for which points τ i will be the knots of the spline, while points x i will be multiple knots of the interpolation.We shall construct a cubic spline of defect 2 in the interval [a, b] that meets the following conditions = ( ) , Denote through ϕ i , i=1,... , N the unknown values of the function in the knots of spline τ i .
To construct the spline, we record the Hermitian interpolation polynomial [22] of third degree in each of the intervals for τ i-1 ≤x i ≤τ i , for τ i ≤x i ≤τ i+1 .
It is obvious from equalities (3), (4) that condition (1) is met.To determine magnitudes Q 1 and Q 2 , we shall employ condition (2), that is, the following relationships must be performed: Determine the derivatives, found above, at points x i and x i+1 .
Using the above notations for steps h i and μ i , we obtain: In equation ( 9), we increase the index by 1 and find an expression for Q 2 .
( ) 2 ( ) , ( ) To ensure the smoothness of the obtained curve, that is the continuity of the first derivative, we demand that relationship Equating expressions ( 13) and ( 14) and substituting values Q 1 and Q 2 , we obtain a system of linear algebraic equations with a three-diagonal matrix for determining ϕ i : x h Record expression (15) in the form: where 2 , To close the system of equations, we add conditions: It is obvious that values of A i , B i (1) , B i (2) , C i are positive and 0<α i <1, where α i =μ i /h i .If B i (1) >A i and B i (2) >C i , system (16) will have a diagonal advantage.
If condition B i (1) >A i is met, we obtain inequality >C i is fulfilled, we obtain inequality Thus, the system of equations ( 16)-( 19) has a diagonal advantage, hence it follows the existence and uniqueness of the solution to system [23].
Note that when one changes parameters μ i (shape parameters of the curve), we obtain different curves, among which one selects the most suitable variant for a practical application.

Examples of calculations
We shall illustrate computational properties of the resulting curve by drawing the following examples.

1. Example 1
Assume a grid function is assigned in the interval 0≤x≤11.Values of the function are given in Table 1.Accept μ i =1/2.Fig. 1 shows results of the construction of a spline curve in accordance with the proposed algorithm.In Fig. 1, control points are indicated by points; in this case, the line connecting them is dotted.A solid line indicates the built spline curve.

Fig. 1. Results of the calculation of a spline curve
Fig. 2 shows the curve that is built based on the proposed method, and a curve from paper [11].Values of control points are taken from [11] and are given in Table 2.The charts presented here show that the constructed curve is better in reproducing the shape assigned by control points.In this case, parameters of μ i accepted the following values: μ 2 =μ 3 = =0.714;μ 4 =μ 5 =0.5; μ 6 =μ 7 =0.286.

Table 2
Values of control points Values of control points are given in Table 3.

Table 3
Values of control points  The estimated radii, given in Table 4, show that the built curve rather well approximates a semicircle.An increase in the error at edges of the interval is due to the different length of the chord.
Let us choose now a partitioning on a given semicircle so that the lengths of the chords are the same.We shall then obtain values of control points that are given in Table 5.
Results of calculations are shown in Fig. 4. The radii calculated (Table 6) suggest that this curve is much better at approximating a semicircle.In this variant, the error decreased, especially at the edges of the interval.

3. Example 3
This example demonstrates the algorithm's capacity to select a strategy for changing the shape parameters in order to locally control the shape of the curve.Consider a fragment of the grid function that is set in the interval 0≤x≤12.Values of control points are given in Table 7.

Table 7
Values of control points (fragment) Fig. 5, a shows a fragment of the chart for the constructed spline curve for μ i =h i /2.Fig. 5, b shows result of the calculation in which at section (3.0, 5.0) μ 3 =2/3.This variant demonstrates a local change in the shape of the curve by applying a parameter μ.Fig. 5c displays results of the calculation in which we added to section (3.0, 5.0) one more control point τ 4 =4, F 4 =3, in this case, μ i =h i /2.Fig. 5, d demonstrates the next change in the shape of the curve by using a parameter μ.At section (3.0, 4.0), μ 3 =2/3, at section (4.0, 5.0), μ 4 =1/3.
The above examples demonstrate good approximating properties of the proposed curve, as well as a possibility to locally change its shape depending on control parameters and shape parameters μ.In the framework of present research, we have proposed and substantiated a new method for constructing a spline curve of third degree.A given curve differs from other curves of this type in that the sections of straight lines that connect control points are tangent to it.Location of the touch points, as well as control points, can be assigned interactively and lead to a change in the shape of the curve.This makes it possible to flexibly set the shape of the curve by the user, which was confirmed using the examples of calculations.
Conditions for the assigned partition were found in the form of inequalities, which parameters μ i , must meet, at which the curve does exists and it is unique.These conditions follow from the requirement for a diagonal advantage of the matrix of the system for determining coefficients of the curve.The curve itself possesses a smoothness of С 1 and retains the third degree for any number of control points.Note that the classic cubic spline has smoothness С 2 and requires assigning additional boundary conditions at the ends of the section.The constructed curve employs, as the boundary conditions, values of extreme control points.Finding the coefficients of polynomials that make up the curve comes down to solving a system of linear equations with a three-diagonal matrix.To solve the system, a sweep method is used.The disadvantages include the smoothness of C 1 only; for most practical applications, however, this smoothness is sufficient.
Similar to the Bezier curves, the proposed curve could be used in computer graphics systems and computer systems for technical design.Thus, algorithmic innovations in this field are very important in order to develop the functionality of the specified systems for the graphical interpretation of experiment results, the creation of fonts, patterns, drawings of technical products, specifically parts and elements of transportation vehicles' bodies, etc.
The idea of applying additional points, as well as conditions for the fulfillment of continuity of the first derivatives of the curve in them, was proposed in [20,21] to build and substantiate the new parabolic spline.Possible continuation of the work might include the application of the proposed approach in order to represent parametric curves and surfaces.The limitations of the proposed method include the presence of conditions for the shape parameters, which must be met when constructing the curve.

Conclusions
1. We have proposed a method for constructing a piecewise-cubic spline curve, which possesses properties of both the spline and the Bezier curve.The resulting curve has a smoothness of С 1 and retains third degree for any number of control points.A search for coefficients of the curve comes down to solving a system of linear equations.
2. Conditions were found in the form of inequalities, which parameters μ i , must meet, at which the curve does exists and it is unique.These conditions follow from the requirement for a diagonal advantage of the matrix of the system for determining coefficients of the curve.
A series of computational experiments were performed, which showed that the curve effectively inherits the shape assigned by control points (Example 1).A comparison to the results of other studies revealed that the proposed curve is better at reproducing the shape set by control points (Example 1).The curve is good at approximating a semicircle, which is quite a challenging task in the theory of approximations (Example 2).By using the curve's shape parameters, it is possible to locally control its shape and obtain different curves, among which one selects the variant that is best suited for practical application (Example 3).

F
i 0 0.3 0.4 0.458 0.490 0.5 0.490 0.458 0.4 0.3 0 Results of the construction are shown in Fig. 3. Designations in this Figure correspond to those in Fig. 1.This example demonstrates a good possibility for the approximation of the arc of a semicircle using the proposed curve.

Fig. 3 .
Fig. 3. Results of the construction of a curve for a uniform partitioning

Fig. 4 .
Fig. 4. Results of the calculation of a spline curve for irregular partitioning

Table 4
Radius of the curve's constructed points (τ i , ϕ i ), (x i , f i )