CONSTRUCTION DEVELOPMENT OF CURVES AND SURFACES AT THE SOLUTION OF VARIOUS PROBLEMS

The implementation results of the computer graphics construction of curves and surfaces by using polynomial methods, cubic spline interpolation methods, and methods of applying the B-spline curves and Nurbs-surfaces at the solution of mining and geometric problems are presented.


Introduction
In order to solve the mining and geometric problems, being a part of the integrated packages of mining, it is necessary to construct the curves and surfaces.This construction is used for the spatial variability of the quality indicators, mapping of ore bodies in 2D-and 3Dgraphics, modelling of the pit surface and also for the evaluation of its displacement, estimation of reserve and accounting of ore mining.
Nowadays the following methods of curves and surfaces' construction to solve the geometric problems of mining are widely used: 1. Method of construction by using a polynomial.2. Method of construction by using a cubic spline interpolation.
3. Method of construction by using B-splines.
It should be noted that it is important to have your own domestic development for your research.The use of programming tools and computer graphics gives an opportunity to simulate various inputs and apply different construction methods of curves and surfaces.This approach is much more effective than the use of the standard packages such as MS Excel, Matlab.For instance, MS Excel is limited to the 6-th degree when constructing the polynomial curves, the Matlab package, despite the fact that it is a powerful mathematical laboratory, lacks the construction methods of polynomial surfaces and can be implemented only with the certain types of interpolation splines.
In this regard, the authors propose to develop a package of constructing curves and surfaces in the Visual C++ programming language for Windows by using the open graphics library OpenGL in order to work with computer graphics.The individual modules of this package are integrated into the information system of geological and surveying software.

110
The main aim of the article is the comparative characteristics of the construction methods of curves and surfaces by using the polynomial, the spline interpolation, B-splines, their implementation in computer graphics, and the choice of the most efficient method to solve the geometric problems of mining.This should be achieved with the maximum accuracy and minimum labor costs for the preparation of the input data.

B-spline curves and Nurbs-surfaces at the solution of mining and geometric problems
In practice, there are often such situations when it is necessary to determine the dependence of the calculated value based on the input value according to the numerical data.At constructing curves it is necessary to define the function y = f (x), which describes more accurately the dependence of the resulting index on the chosen factor.
To calculate the parameters of the curve, the least squares method is used.It provides the minimum sum of the squares deviations between the actual and the received values, that is, to observe the condition: where i y -is an actual value of the resulting index; i y  -is a calculated value of the index; n -is a number of observations.
For example, the dependence of the resulting index y on x factor is expressed by the linear dependence, bx a y

 
, where a and b -are the unknown coefficients of the regression equation.Having found the partial derivatives of the parameters a and b to find the unknown, we have a system of the following two linear algebraic equations: While solving this system of the linear equations, we obtain the formula for calculating the values of the following parameters: The straight line is a special case of the polynomial (a polynomial of the first degree), a model which in general can be summarized as follows: where M is the degree of the polynomial.Having calculated the partial derivatives, relative to parameters Ai we obtain a system of M + 1 linear algebraic equations for the parameters Ai: The calculation of the partial to form a system of linear equations is quite a complex process.In this regard, the authors proposed a more simplified version of calculating the coefficients of the unknowns aij and the absolute term bi: where xk, yk -are the coordinates of the control points; n -is a number of the control points ; i = 0…M; j = 0…M.
Hereinafter it is not difficult to solve a system of the linear equations by using the classical methods and to obtain the unknown coefficients of Ai.
For the polynomial to pass through all the checkpoints, its degree should be the one less than the number of the given points.
In Figure1 we present a polynomial of the 10-th to the 11-th degree of the control points defined by their coordinates.The studies have shown that if the degree of the polynomial is close to the number of the control points, despite an increase in the coefficient of determination R 2 , the result of the curve is getting worse.Thus, in Figure 1 the polynomial passes through all the control points, and R 2 = 1.However, the use of such a polynomial is impractical because of the sharp fluctuations between the checkpoints.In practice it is recommended to use polynomials of the small degree, but the degree of the polynomial should be chosen in dependence on the number of the initial data.Such dependence requires our further research.
In addition, the polynomial is not taken into account for the location of the control points, each control point affects the behaviour of the curve.In Fig. 2. we show the profile of the bench in an open pit that is described by a polynomial of the 6th degree.The figure shows that the polynomial curve smoothers the data in average, taking into account all the control points.
To determine the three-dimensional space of the polynomial in z = f (x, y) we use an the algorithm proposed by the authors (Zelensky, Baran, Lysenko, 2012: 75).
For a polynomial of the 5-th degree this dependence can be expressed as the following: Where A0, A1,…,A20are the coefficients to be determined.The coefficients number of the unknown (linear equations), depending on the degree of the polynomial is determined by the following formula: For a polynomial of the 5th degree K = 21.Calculating the partial derivatives with the respect to parameters Ai, we obtain the system of the 21 linear equations: are the coefficients of linear equations,  b -are the free terms of the equations system,  -is a number of rows (equations); S -is a column number.Thus, we have simple dependences for the determination of coefficients  We pointed out the following drawbacks of using polynomials at the construction of curves and surfaces: 1.The high degree of a polynomial is limited by the permissible value of the automation data.At the sufficiently high degree of the polynomial the accuracy for the coefficients calculation of a polynomial model increases.
2. No local control.The construction of the polynomial model includes all entry points and the change of the coordinates of one point affects the behaviour of the curve or the surface.
3. If the degree of the polynomial is close to the amount of the input data, despite the increase in the coefficient of determination R 2 , the result of the curve is getting worse.This gives rise to the sharp variations between the control points.
Another important method for the construction of curves and surfaces are splines.They allow you to construct the smooth curves or surfaces consisting of small fragments.
Among the most common are the interpolation splines that pass through all the checkpoints and the approximation splines, which approach the points.
In spline interpolation the coefficients of the piecewise polynomial are calculated between two control points.Coefficients are calculated in such a way that the derivatives at the points of the contact are the same.The curve (surface) is continuous and smooth.
Among the interpolation splines the natural cubic spline stands out (Wright, Lipchak, 2006: 603) with the continuous first and second derivatives.This spline is global, that is, a change of one control point affects the entire behaviour of the curve.In Figure 4.there is an implementation result of the natural cubic spline interpolation. 115

Fig. 4. Cubic spline interpolation
When implementing this spline in each area between two adjacent control points, the following equation is calculated: In conditions of the continuity of the first and the second order, we get the formula for the coefficients calculation of the spline: For the comparison, we present a polynomial with the same input data that passes through all the control points, in Figure 1; its use is not advisable because of the sharp variations between the checkpoints.
The next type of the spline interpolation is the Hermit spline.It is local, in contrast to the natural cubic spline, and you should set the appropriate values of the first derivatives, besides the values at the control points, for its construction .The change of the derivative at the control point affects only the adjacent points.In this way you can control the first derivatives of the starting points in order to change the behaviour of the curve.

Fig. 5. Hermit spline interpolation
To implement Hermit splines we should find n-1 cubic polynomial: Each piecewise polynomial coefficient is calculated in the following way: To set the first derivative (coefficient bk ), we recommend the following formula: . In this formula, the parameter c varies from 0 to 1.According to this formula, the derivative in the middle of the segment is equal to the difference between the first split on the whole interval, multiplied by the coefficient c, with which you can control the curve.
The spline interpolation can be used for contouring, smoothing, etc.According to the last equation a piecewise polynomial prediction can be made.
The disadvantages of the spline interpolation are: 1.The initial data control points on the axis OX should be sorted in ascending x0 < x1 < x2 <... < xn.
2. It is necessary to obtain and store in memory 4 * (n-1) parameter for the calculation of the piecewise cubic polynomials, where n -is a number of the control points.
For practical purposes B-splines are widely used, which are intended to approximate the input data (Zelensky, Baran, Lysenko, 2012: 140-154).The approximation methods are used mainly in the design tools and at the solution of mining-geometric problems to create an 117 object.By far B-splines are the industry standard for the designing and modelling of surfaces and are the major tool of the well-known OpenGL graphics library.
Each point of the B-spline curve is described by the following equation: , where (L + 1) -is a number of the control points (numbered points from 0 to L); Pk= (xk, yk) -are the coordinates of the control points; wk -are the weights of the control points; Nk,m(t) -are the connecting B-spline functions; m -is the connection order of the B-spline functions, Nk,m(t); t0, …, tmax (tmax -is a maximum value in the knot vector t, equal to L -m + 2).
Each B spline function is based on the polynomials of some order m.If m = 3, the polynomials will be of the 3 order, and hence, the power of 2, that is, will be the quadratic Bspline.If m = 4, the corresponding polynomials have the 3 power, which means, they will be the cubic ones.
The basic formula describing the B-spline function Nk,m(t), is as follows: ) ( where k = 0, 1, …, L. This definition is recursive and describes the function construction of mth -order of the two B-spline functions of (m -1)th order.To initialize this formula, we have to define the function of the first order.It is a constant unit function within its range: Note, that the sum of the set feature is automatically equal to one for all values of t.The weight coefficients (wk) allow to manage the influence of the specific control points in the behaviour of the curve.So, if you want the curve to pass through a checkpoint, it is necessary to give the maximum weight.For this we are forming an array of weights (w) in the following way: That is, all the points are given the unit weight, and only the fifth point is given the weight equal to 100.
The result of the construction of B-spline curve based on 11 test points is shown in Fig. 6.The order of the polynomial for the construction of the corresponding curve is chosen m = 4 (cubic polynomial).
Let's point out the main benefits of B-spline: 1. Ease of calculation.Connecting functions are evaluated in the simple recursive manner.It is advisable to use functions to connect the second or the third degree.
2. Local control over the curve.The change in one control point does not affect the change in the curve, and it is only in its particular area.This is due to the fact that only a small 118 number of the control points, depending on the degree of the polynomial, affects each connecting function.
3. Using weights to pass through the strictly defined locations.

Fig. 6. The construction result of B-spline curve by using weight
In Figure 7 we demonstrate the profile of the bench in an open pit, described by Bspline, which has repeated the profile of the benches with the high accuracy.For the comparison, Fig. 2.demonstrates the profile of the bench in an open pit, that is described by a polynomial of the 6th degree.In this case, the localization of the control points is totally absent.

Benc h B-spline curve 119
When applying the construction methods of B-spline curves on the NURBS-surface, the following formula is used: NURBS stands for the uneven rational B-spline (non-uniform rational B-splines). Figure 8. presents the Nurbs-surface benches in 3D-graphics (Zelensky, Baran, Lysenko, 2012: 157).For the passage of the surface strictly through the edges (crest and toe) of the bench, much higher weight is assigned to the corresponding nodes on the network a (accepted value of 1000).B-spline is used both for the visualization of curves and surfaces in 3D-graphics and the accounting operations.B-spline in the form of a surface can be used to model the surface pit and for the evaluation of its displacement ,the calculation of reserves, for the ore-mining accounting, mapping of the ore body, isolation lines.

Conclusions and Suggestions
The comparative characteristics of the construction methods of curves and surfaces is made by the authors in the Visual C ++ language for Windows by using the tools of the OpenGL graphics library.The developed mathematical and algorithmic method of the surfaces construction, based on B-splines (NURBS-surfaces) helped to create the most effective automation ways of the ore grades mapping, construction of the pit surface, surveying of the controlling weightier and the total calculation of reserves. 112

Fig. 1 .
Fig. 1.Interpolation polynomial of the 10-th degree A0, A1, ..., A20 and the free terms  b : the exponents, depending on the row l; kS, рS -are the exponents, depending on the number of columns S:

Figure 3 .Fig. 3 .
Figure3.shows an implementation of the polynomial in the fourth degree space.
1) -is a number of the control points on the axis OX (numbered points from 0 to M); (L + 1) -is a number of the control points on the axis OY (numbered points from 0 to L); Pi,k = (xi,k, yi,k, zi,k) -are the coordinates of the control points; wi,k -are the weight coefficients of the control points; Ni,m(u) и Nk,n(v) -are the correspondingly connecting Bspline functions in the direction of the axes OX and OY; m and n -, respectively, are the connection orders of B-spline functions Ni,m(u) и Nk,n(v); u0, …, umax (umax-is the maximum value in the knot vector u in the direction of the axis OX, equal to M -m + 2); v0, …, vmax (vmaxis the maximum value of the knot vector v in the direction of the axis OY, equal to Ln + 2).