Abstract
This paper is dedicated to development of mathematical models for polynomial spline curve formation given extreme vector derivatives. This theoretical problem is raised in the view of a wide variety of theoretical and practical problems considering motion of physical objects along certain trajectories with predetermined laws of variation of speed, acceleration, jerk, etc. The analysis of the existing body of work on computational geometry performed by the authors did not reveal any systematic research in mathematical model development dedicated to solution of similar tasks. The established purpose of the research is therefore to develop mathematical models of formation of spline curves based on polynomials of various orders modeling the determined trajectories. The paper presents mathematical models of spline curve formation given extreme derivatives of the initial orders. The paper considers construction of Hermite and Bézier spline curves of various orders consisting of various segments. The acquired mathematical models are generalized for the cases of vector derivatives of higher orders. The presented models are of systematic nature and are universal, i.e., they can be applied in formation of any polynomial spline curves given extreme vector derivatives. The paper provides a number of examples validating the presented models.
1. Introduction
Formation of composite polynomial spline curves given the initial extreme derivatives at the endpoints of the segments is finding increasing application in solutions to a variety of tasks of science and manufacture. For example, in computer animation, camera motion along a curvilinear trajectory is modeled as motion along a curved line , . Camera trajectory calculation is performed with consideration for laws of variation of camera velocity and acceleration throughout the trajectory [1].
In machine-building cutting tool trajectory calculation through Hermite cubic spline interpolation is applied in pocket machining of surfaces of arbitrary shape. In this regard, it is noted that that cutting tool acceleration is not continuous, which results in machining defects [2].
One of the main problems in development of high-speed cutting NC systems is achieving seamless cutting tool motion. The models of NC systems developed for this purpose ensure smoothness of acceleration and continuity of jerk defined by the third vector derivative [3,4,5]: .
The fourth vector derivative is called snap . It is applied, for example, in development of minimum snap trajectory for quadrotors [6].
Papers [7,8] apply the sixth vector derivative in Apophis asteroid trajectory calculation in Earth gravity field.
As follows from the mentioned papers, spline curve formation through extreme derivatives (spline curve extreme derivative of nth order) is relevant in solution to a variety of practical tasks.
There are approaches to development of mathematical models of formation known from scientific papers on spline curve theory. One should trace the origins of this development to cubic spline interpolation through formation of Hermite segments given first-order extreme derivatives subsequently connected with smoothness into cubic [1,9,10,11,12,13,14,15,16,17,18,19]. The model later became the basis for development of mathematical model of a Hermite segment (spline curve segment) described by a polynomial of the fifth order given the extreme derivatives of the first and the second order [1]. However, in subsequent formation of the mathematical model, the first and the second vector derivatives at the first point of the first segment and at the final point of the final segment were not initially specified, therefore the mathematical model resulted in a system of linear equations with the number of unknown values exceeding the number of equations. In the course of development of this system, the fact that it is incomplete has been revealed. The author of paper [1] made a decision to reduce the number of unknown values down to the number of equations by assigning values to certain extreme vector derivatives. The resultant approach to solution of the problem of formation is of purely theoretical nature. In practice, the more relevant approach is formation. According to this approach, both the segment and the composite curve acquired through connection of segments with smoothness are formed through the same mathematical model.
We have to acknowledge the paper of theoretical nature proposing a mathematical model of and formation in the form of B-spline curves interpolating discrete arrays of points in the plane [20]. The paper considers vector derivatives of orders one to three as given extreme derivatives. It is noted that the problem of spatial interpolation with consideration for curvature and torsion in order to acquire does not yet have a solution. In this regard, the authors of the paper [20] provide an explanation that it is virtually impossible to evaluate corresponding directions and magnitudes of vectors of the second and the third derivative in formation. We were unable to find more modern papers in this area of research.
Therefore, with regard for practical requirements in models and algorithms for formation of curves , and taking into account the existing theoretical basis of mathematical models of spline curves, the following purpose of the research is established: to develop mathematical models of formation of polynomial curves , and to validate these models on numeric experiments.
Section 2 of the present paper considers the conditions for formation of spline curves given extreme derivatives of the initial orders and provides generalizations for the case of first vector derivatives.
Section 3 considers the mathematical models and many examples for closed and non-closed polynomial spline curves of various orders and consisting of various numbers of segments.
2. Conditions for Spline Curve Formation Given Extreme Derivatives
At the initial stage of analytical spline curve shaping given extreme derivatives it is essential to know the total number of conditions for shaping. Knowing the total number of conditions allows one to determine the degree of a polynomial describing the segment—or each segment—of the desired spline curve.
2.1. Conditions for Hermite Cubic Sspline Curve Shaping
It is known that a cubic spline segment can be constructed given boundary conditions , and , [1,9,10,11,12,13,14,15,16,17,18,19] (see Figure 1).
Figure 1.
Hermitian cubic segment.
In the general case, the order of polynomial describing the segment through extreme derivatives is determined through formula , where represents the number of pairs of extreme derivatives at segment endpoints. As follows from the technique of algebraic definition of polynomial coefficients of cubic spline , , the existence of four boundary conditions resulting in respective algebraic equations is sufficient for unambiguous definition of four coefficients of the polynomial.
Eight conditions defining four vector coefficients of each polynomial describing a segment are required in order to define a cubic spline curve consisting of two segments. These conditions include the given boundary conditions , ; , , and intermediate conditions in connection point (see Figure 2): , ; , , where and are polynomials of respective segments and .
Figure 2.
Two-segment Hermite cubic spline curve.
As follows from the intermediate conditions, the point should be considered double as well as the unknown derivative at that point. Each boundary and intermediate condition is described by a linear algebraic equation. Simultaneously, these equations unambiguously define the unknown coefficients of the polynomials of the connected segments. A general cubic spline curve consisting of segments, where is the number of points of the curve, is formed through a total number of conditions, where is obviously defined through formula . This number is also the total number of the unknown coefficients of all polynomials of the third degree describing the connected segments.
2.2. Conditions for Formation of a Spline Curve of Segments Described by Polynomials of Higher Degree
A segment with two pairs of extreme derivatives (see Figure 3) is described, according to the formula , by a polynomial of the fifth degree , . Six conditions , , ; , , unambiguously define six coefficients of this polynomial [1].
Figure 3.
Hermitian fifth-degree segment.
Formation of a spline curve consisting of two segments defined by fifth-degree polynomials requires 12 conditions. These conditions include the given boundary conditions , , ; , , ; the intermediate conditions in connection point (see Figure 4): , ; , ; , , where and are polynomials of the fifth degree of respective segments and .
Figure 4.
Fifth-degree Hermite spline curve of two segments.
Obviously, the point should be considered double, as well as the first- and the second-order derivatives at it. The algorithms of formation of Hermite spline curves based on fifth-degree and seventh-degree polynomials are thoroughly considered in Section 3.1, Section 3.2, Section 3.3, Section 3.4 and Section 3.5 respectively.
Formation of a general spline curve consisting of smoothly connected segments defined by fifth-degree polynomials requires the total number of conditions. This number is also the total number of the unknown coefficients of all fifth-degree polynomials describing segments.
If we consider two given points and , as well as the first vector derivatives at each point, then, according to the formula , the degree of the polynomial defining a segment with endpoints and equals . It is possible to define the total number of conditions for formation of a general spline curve consisting of segments each described by a polynomial of degree . It is calculated through the formula . Thus, for example, if and , , which correlates to the spline curve depicted on Figure 4.
2.3. Conditions for Closed Spline Curve Formation
In order to form a closed spline curve given a discrete array of points, it is required to fulfill the total number of conditions. Here represents the number of pairs of extreme derivatives of the initial orders at the endpoints of the formed spline curve, represents the number of segments. For example, given four points , with respective derivatives , it is possible to form a closed Hermite spline curve based on a fifth-degree polynomial (see Figure 5). The resultant curve consists of four segments connected with smoothness .
Figure 5.
Closed spline curve based on a fifth-degree polynomial.
Obviously, the total number of conditions defining this spline curve equals , i.e., six conditions for each segment of the curve. Let us list them: the boundary (given) conditions ,… , whereby , ; , ; , ; , ; ; the intermediate (sought) conditions in the segments connection points are as follows: , , , , , , , ; , , , , , , , .
Obviously, in formation of a polynomial closed spline curve each point of the given discrete array is considered double, as well as each defined vector derivative at any point of the array. The formation of closed polynomial splines is thoroughly considered on examples in Section 3.3 and Section 3.7.
3. Spline Curve Formation Given Extreme Derivatives
In the following section let us consider the construction of mathematical models of polynomial spline curves consisting of various numbers of smoothly connected segments. The segmental formation of spline curves is based on the concept of a continuous (or smooth) connection of segments at their common point. In the theory of spline curves and spline surfaces two types of smoothness are known: geometric and parametric [1,9,13]. Within the framework of this work, we use the strict concept of smoothness.
3.1. Construction of a Hermite Segment Given First- and Second-Order Extreme Derivatives
Let us assume the points and , as well as respective boundary conditions , and , are given (see Figure 6).
Figure 6.
Initial conditions for construction of a fifth-degree Hermite spline curve segment.
Let us construct a Hermite spline curve segment , passing through the points , and conforming to the given boundary conditions. Given the two endpoints and the initial m pairs of derivatives in the endpoints, it is possible to calculate the interpolating polynomial of order 2m + 1. It is therefore obvious that the sought segment has to be described by a fifth-order polynomial
The vectors , are the first vector derivatives constituting tangent vectors at the endpoints of the sough segment s, while are the second vector derivatives constituting vectors of acceleration of a point tracing out the segment s. Obviously, the given conditions are sufficient in order to define the vector coefficients of the Formula (1).
Let us express the equations for the vector coefficients in the final matrix form :
The matrix Formula (2) of equations defining the vector coefficients of a fifth-degree polynomial describing a Hermite segment corresponds to the known matrix form by D. Solomon [1]. The Formula (2) is the basis for computational algorithms of spline curve formation considered further in the present paper. By substitution of the values of vector coefficients (2) into the Formula (1) we acquire the sought equation of Hermite spline curve segment with parameterization .
3.2. Construction of a Fifth-Degree Hermite Spline Curve of Two Segments and Generalization for the Case of (j − 1) Segments
Let us consider the connection of two Hermite segments and (see Figure 7) given the same boundary conditions as for the previously considered case of one segment s.
Figure 7.
Calculated fifth-degree Hermite spline curve of two segments.
Parameterization of the segments is fulfilled in range for the segment and for the segment . Without loss of generality, we accept that at the initial point of segment and at the initial point of segment . Let us express the polynomial equation of the segments in the following form: . Let us express the derivatives of vector function
For at the initial point of segment we acquire
At the final point of segment we acquire
For at the initial point of segment we acquire
At the final point of segment we acquire
Thus, through (3), we acquire the expressions for the first three coefficients of the equation for the first segment : The remaining vector coefficients are determined through the system of three linear equations
The expressions of the first three vector coefficients of segment follow from (4): The remaining vector coefficients and are determined through the system of three linear equations
The equations for these coefficients are of the following expanded form
In order to connect segments and in point , it is required to determine vectors and . This can be achieved through equality of the third and the fourth derivatives of vector functions of the segments at the connection point: , or in expanded form
, or in expanded form
The system of linear Equations (7) and (8), with consideration (5) and (6) allows us to determine the sought vectors and .
where:
Under the condition of parameterization of segments : and : the coefficients , , and α, β have the following values
The mathematical model of two-segment shaping of a spline-curve proposed in this subsection is structurally different from the well-known model [1] due to the assignment of extreme derivatives.
Matrix Formula (2) and Algorithm 1 make it possible to generalize to the case of the formation of a smooth spline Hermite curve from (j − 1) segments. In the generalized representation the matrix of vector coefficients for the equations of the segments of the Hermitian spline curve of the fifth degree, connected by the smoothness , has the Formula (12).
Example 1.
Given the following conditions for the three segments:, , , , , , , it is required to construct a Hermite spline curve consisting of three segments connected with smoothness.
In order to construct a spline curve, let us apply the matrix Formula (19) for the case . In this case the vector parameters of the geometric matrix are determined through a uniquely solvable system of four linear equations in four unknowns. The system can be solved through one of the direct methods known in the field of linear algebra, e.g., the Gauss–Jordan method.
Figure 8 depicts visual rendering of the result of the calculation. It demonstrates the sought three segments and their subsequent connection with the order of smoothness .
Figure 8.
Fifth-degree Hermite spline curve of three segments.
| Algorithm 1 For obtaining a spline curve with polynomial equations of the fifth degree of segments and has the following text form: |
|
The values of curvature and torsion at boundary points , of the connected segments are listed in Table 1.
Table 1.
Curvature and torsion values at boundary points of the segments.
Example 2.
Figure 9 and Table 2 show the result of construction of a fifth-degree Hermite spline curve consisting of seven segments given the following knot points and boundary conditions:,,,,,,,,,,,. The method and the algorithm are identical to the ones applied in Example 1.
Figure 9.
Fifth-degree Hermite spline curve of seven segments.
Table 2.
Curvature and torsion values at boundary points of the segments.
The solution of the examples 1 and 2 allow us to generalize the proposed algorithm and solution method for the case of connected segments of fifth-degree Hermite spline curve.
The system of linear equations for the case of unknown and is of the following form
The generalized system of Equation (13) can be expressed in the following matrix form
The generalized system matrix (parametric matrix) (13) or (14) consists of linear equations in unknown. It is of size and holds real numbers. This matrix is invertible and therefore the system of linear equations is uniquely solvable. It can be solved through Gauss–Jordan method, just as the Example above. The matrix Formula (14) of the generalized system of Equation (13) conforms to this method.
3.3. Construction of a Closed Fifth-Degree Hermite Spline Curve
In order to construct a closed Hermite spline curve of i segments subsequently connected in the given j knot points with smoothness , it is required to fulfill the following boundary conditions at connection points: , , , . Taking these conditions into account the matrix (15) is used to determine the vector coefficients of the segment equations.
Example 3.
It is required to construct a closed Hermite spline curve of four segments subsequently connected with smoothnessat knot points,,,.
Let us add vectors and to the list of unknown vectors in the system of equations and acquire the system of eight equations in eight unknowns:
Let us transform the system (15) into matrix form in order to facilitate the solution through Gauss–Jordan method (16).
The unknown vector coefficients are calculated through (16) taking into account the closure. In the case of a closed spline, the matrix for calculating vector coefficients is expanded by adding a closing segment, the equation of which contains vector coefficients . Figure 10 and Table 3 show the result of construction of a closed spline curve of four segments.
Figure 10.
Closed fifth-degree Hermite spline curve of four segments.
Table 3.
Curvature and torsion values at boundary points of the segments.
The system of Equation (15) and the matrix Formula (16) can be generalized for the case of j knot points and j segments of a closed Hermite spline curve. The generalized system of equations is of the following matrix form:
The matrix of generalized system of equations consists of linear equations in unknown ; and is of size . Its elements are also real numbers. It is invertible and therefore the system of linear equations is uniquely solvable. It can also be solved through the Gauss–Jordan method. The matrix Formula (17) conforms to this method.
Example 4.
Figure 11 and Table 4 show the results of construction of a closed Hermite spline curve of 14 segments given the knot points:,,,,,,,,,,,,,. The method and the algorithm are identical to the ones applied in Example 3.
Figure 11.
Closed fifth-degree Hermite spline curve of 14 segments.
Table 4.
Curvature and torsion values at boundary points of the segments.
3.4. Construction of a Hermite Segment Given Boundary Derivatives of First, Second, and Third Orders
Given points and with the respective boundary conditions , , and , , (see Figure 12), it is required to construct a segment of a Hermite spline curve.
Figure 12.
Initial conditions for construction of a seventh-degree Hermite spline curve segment.
Obviously, a segment of Hermite spline curve has to be described by a polynomial
Vectors , are the first vector derivatives constituting tangent vectors at the endpoints of the sought segment s. are the second vector derivatives constituting vectors of acceleration of a point tracing out the segment s and are the third vector derivatives constituting vectors of jerk of a point tracing out the segment s. Obviously, the given conditions are sufficient in order to define the vector coefficients of the Formula (18). Let us express the first, the second, and the third derivatives of vector function
We apply parameterization . In this case the values of the first four vector coefficients can be acquired
The rest of the vector coefficients are determined through the equations
that lead us to the system of four linear equations
The values of coefficients and follow from the system of Equation (20)
Let us transform the expressions (19) and (20) into the matrix form
If we substitute the expressions of vector coefficients (21) into the Formula (18), we acquire the sought equation of a Hermite spline curve segment.
3.5. Construction of a Seventh-Degree Hermite Spline Curve of Two Segments and Generalization for the Case of (j − 1) Segments
Let us consider connection of two segments and (see Figure 13) given the same boundary conditions as for the case of one segment s previously considered in Section 3.4. Parameterization of segments is fulfilled in ranges and for respective segments and . Without loss of generality, we accept that at the initial point of segment and at the initial point of segment . Let us express the polynomial equation of the segments in the following form: . Let us express the derivatives of vector function
Figure 13.
Seventh-degree Hermite spline curve of two segments.
For k =1 at the initial point of segment we acquire
At the final point of segment we acquire
For k = 2 at the initial point of segment we acquire
At the final point of segment we acquire
Thus, through (22), we acquire the expressions for the first four coefficients of the equation for the first segment : . The remaining vector coefficients are determined through the system of four linear equations
The expressions of the first four vector coefficients of segment follow from (23): . The remaining vector coefficients , , , and are determined through the system of four linear equations
Vectors , , and at the knot of connection of segments and are unknown. These vectors are determined through the conditions of equality of fourth, fifth, and sixth derivatives of vector functions at the connection knot:
, or in expanded form
, or in expanded form
, or in expanded form
The sought vectors , , and are determined through the system of linear Equations (25)–(27) taking into account the Equations (23) and (24) with parameterization for segments and
The matrix Formula (21) and Algorithm 2 allow us to generalize to the case of the formation of a smooth spline Hermite curve from (j − 1) segments.
In the generalized representation the matrix of vector coefficients for the equations of segments of the Hermitian spline curve of the seventh-degree, connected by the smoothness , has the Formula (32).
Example 5.
It is required to construct a Hermite spline curve of the seventh degree consisting of three segments given the following boundary conditions:,,,,,,,,,.
In order to construct a spline curve, let us apply the matrix Formula (32) for the case . In this case, the vector parameters of the geometric matrix are determined through a uniquely solvable system of six linear equations in six unknowns.
Figure 14 depicts visual rendering of the result of the calculation. It demonstrates the sought three segments and their subsequent connection with order of smoothness .
Figure 14.
Initial data and the result of connection of three segments of a seventh-degree Hermite spline curve.
| Algorithm 2 For obtaining a spline curve with polynomial equations of the seventh degree of segments and has the following text form: |
|
Table 5 shows the calculation results from Example 5.
Table 5.
Curvature and torsion values at boundary points of the segments.
The mathematical models of shaping of polynomial spline curves obtained in Section 3.2, Section 3.3, Section 3.4 and Section 3.5 have scientific novelty and have not been considered in the scientific literature known to the authors.
3.6. Construction of a Bézier Spline Curve Segment Given Boundary Derivatives of the First and the Second Order
In works [1,12,13,15,18,21], the theoretical foundations of analytical and geometric models of formation of Bézier spline curves are presented. In this paper we propose the method of segmental shaping of these curves based on the same mathematical model as used for Hermite spline curves in Section 3.1, Section 3.2 and Section 3.3.
The points and as well as the respective boundary conditions , and , are given (see Figure 15).
Figure 15.
Initial conditions for construction of a Bézier spline curve segment.
Under the given conditions it is possible to construct a Bézier spline curve segment described by the formula [1,10,13]
where the set of functions forms the Bernstein basis.
Let us express the first, the second, the third and the fourth derivatives of vector function
Vectors , are the first vector derivatives constituting tangent vectors at the endpoints of the sought segment s. Vectors are the second vector derivatives constituting vectors of acceleration of a point tracing out the segment s. Vectors are the third vector derivatives constituting vectors of jerk of a point tracing out the segment s. Vectors are the fourth vector derivatives constituting vectors of snap of a point tracing out the segment s.
This allows us to acquire the values of the first three vector coefficients
The three remaining vector coefficients are determined through the equations
From the Equation (35) follows the system of three linear equations
The expressions for coefficients , and follow from the system of the Equation (36)
The expressions (34) and (36) can be expressed in the matrix form with parameterization
3.7. Construction of a Fifth-Degree Bézier Spline Curve of Two Segments
Let us consider the connection of two segments of a fifth-degree Bézier spline curve (see Figure 16) given the same boundary conditions as for the case of one segment s previously considered in Section 3.6.
Figure 16.
Knot and control points of two connected segments of a fifth-degree Bézier spline curve.
Let us express the equation of the segments in the following form: ; , . A Bézier spline segment has control points , , , and passes through knot points , .
For k = 1 at the initial point of segment we acquire
For k = 1 at the final point of segment we acquire
For k = 2 at the initial point of segment we acquire
At the final point of segment we acquire
It is required to determine eight vector coefficients corresponding to vectors of the four control points of each segment. At the initial point of segment and the final point of segment the following boundary conditions are given: , and , . Therefore, through (38), we acquire the expressions for the first three vector coefficients of the equation for the first segment : , and . The remaining vector coefficients , and are determined through the system of three linear equations
Through (39) we acquire the expressions for the first three vector coefficients of the equation for the second segment : , , . The remaining vector coefficients , and are determined through the system of three linear equations
In the connection of segments and at the point with smoothness , vectors and are unknown. These vectors are determined through the condition of equality of the third and the fourth derivatives of vector functions of the segments at the connection point: , or in expanded form
and , or in expanded form
The sought vectors and are determined through the system of two linear Equations (43) and (44) taking into account the system of Equations (39)–(42)
The Equations (44) and (45) in calculation of the unknown vector derivatives and at the point of connection of fifth-degree Bézier spline curve segments and match the corresponding Equations (9) and (10) of the unknown vector derivatives and at the point of connection of fifth-degree Hermite spline curve segments and . In this case, in the Formulas (9) and (10), the coefficients take values according to (11) for .
This allows us to speak of universality of the proposed algorithm of determination of the unknown vector derivatives in the tasks of formation of various polynomial curves. Thus, the vector derivatives and at the points of connection of fifth-degree Bézier spline curve segments are determined through the Equations (9) and (10), same as for the case of a Hermite spline curve. However, the acquired equations for the unknown vector coefficients of Bézier spline curves and Hermite spline curves are different. The unknown vector coefficients corresponding to the control points of the composite Bézier spline curve are calculated through (46). The generalized matrix form for calculating vector coefficients for a non-closed fifth-degree Bézier spline has the form
Example 6.
The following conditions for the three segments are given:,,,,,,,. It is required to construct a Bézier spline curve of these segments. The unknown vector derivativesandat the points of connection of the segments are calculated as in the case of a smooth connection of three segments for a Hermite spline curve of the fifth degree consisting of three segments (see Example 1). The unknown vector coefficientsare calculated through (46).
Figure 17 depicts visual rendering of the result of the calculation. It demonstrates the sought three segments of a Bézier spline curve and their subsequent connection with smoothness .
Figure 17.
Fifth-degree Bézier spline curve of three segments.
Table 6 lists the values of curvature and torsion at the boundary points of the connected segments, where j = 1, …, 4.
Table 6.
Curvature and torsion values at boundary points of the segments.
Example 7.
It is required to construct a closed fifth-degree Bézier spline curve of five segments subsequently connected in knot points,,,,.
The unknown vector derivatives and , j = 1,…,5 are determined through the matrix form of the generalized system of Equation (17). This is due to the fact that the calculation of the unknown vector derivatives and at the connection points of Hermite and Bézier spline segments are formally identical.
The system of equations for the unknown vector derivatives for the current example is of the following matrix form:
The unknown vector coefficients are calculated through the system of Equation (46) expanded by adding a closing segment equation containing the vector coefficients .
Figure 18 and Table 7 present the results of the construction of a closed fifth-degree Bézier spline curve of five segments.
Figure 18.
Closed fifth-degree Bézier spline curve of five segments.
Table 7.
Curvature and torsion values at boundary points of the segments.
The mathematical models of shaping of Bézier spline curves obtained in Section 3.6 and Section 3.7 also have scientific novelty. These models were not previously considered in the scientific literature on computational geometry known to the authors.
The considered examples were tested using the software package of the Waterloo Maple computer mathematics system—Maple 2020 Free Trial. Access to the computer code for the examples No.1–No.7 considered in the work is possible by the link: https://www.mapleprimes.com/posts/213421-Spline-Curves-Formation-Given-Extreme-Derivatives?sp=213421.
4. Discussion
The mathematical models of formation of various polynomial spline curves considered in Section 3 determine the computational algorithms of formation. These algorithms are validated on numerous examples provided in Section 3. The uniformity and systematic nature of the algorithms allows us to present them in the form of a general algorithm of spline curve formation (see Figure 19).
Figure 19.
General algorithm of spline curve formation.
This general algorithm allows us to perform calculation of vector derivatives at points of connection of segments forming a spline curve as well as vector coefficients of polynomials. The algorithm consists of modules providing the following functions:
Module 1: Initial conditions input. The initial conditions for spline curve formation include: the number of points of discrete array j; the vectors of discrete array of points ; the number of pairs of extreme derivatives m; the vectors of extreme derivatives at point ; the vectors of extreme derivatives at point .
Module 2: Determination of order of the polynomial.
Module 3: Conditional step: check whether the curve is closed. The curve is considered closed if the vectors of extreme derivatives at points and are not given as the initial conditions.
Module 4: Formation of a matrix of size for the unknown vector derivatives at connection points of a closed spline curve, where represents the total number of conditions.
Module 5: Formation of a matrix of size for the unknown vector derivatives at connection points of a non-closed spline curve, where represents the total number of conditions.
Module 6: Calculation of vector derivatives at segment connection points.
Module 7: Calculation of polynomial vector coefficients for each spline curve segment.
Module 8: Acquiring the vector equations of spline curve segments.
Aside from uniformity, the proposed algorithms are to a certain extent universal and can be applied in solutions to the problems of formation of polynomial spline curves of various types generated through Hermite splines, Bézier splines, B-splines. It has to be mentioned that the Gauss–Jordan method has time complexity , where p is the size of the initial data for solution of a system of i equations in i unknown. These systems are present in every computational algorithm proposed in Section 3.
Analysis of Algorithms 1–3 (Section 3.2, Section 3.5, and Section 3.7, respectively), analysis of matrices for the formation of vector coefficients in the equations of segments of formed spline curves (Section 3.1, Section 3.2, Section 3.3, Section 3.4, Section 3.5, Section 3.6 and Section 3.7) and analysis of the set of considered numerical examples (examples 1–7, Table 1, Table 2, Table 3, Table 4, Table 5, Table 6 and Table 7) allow us to conclude about the scalability of our proposed method of forming spline curves. The scalability of the method is reduced to the obvious scalability of the matrices of vector coefficients of the segment equations, the connection of which, according to a given degree of smoothness, forms a certain spline curve.
The accuracy of the obtained computational results depends on the specified computation accuracy of scalar invariants at the segments junction point and does not depend on the scalability of the proposed computation method. The examples discussed in the work (electronic link on Page 27) support this thesis. For a given accuracy of calculations (100 decimal places) of an open spline of the Hermite curve of the fifth degree, the resulting absolute calculation error is from 10−99 to 10−94. As an example, the formation of a spline curve consisting of 100 knots is considered. In this case, the obtained absolute error in calculating the curvature at the segments joining knots is as follows: knot ,..., knot ,..., knot . The obtained absolute error in the calculation of the torsion at the knots of joining the segments is as follows: knot ,…, knot ,…, knot . The accuracy of calculating scalar invariants can be quite high, depending on practical feasibility, as well as on the capabilities of the computer hardware.
| Algorithm 3 For obtaining a fifth-degree Bézier spline curve of segments and has the following text form: |
|
5. Conclusions
Vector derivatives form scalar invariants at each regular point of curve , . Scalar invariants formed by vector derivatives ,,,..., have to meet certain requirements. They have to be coordinate system independent, i.e., invariant with respect to coordinate system transformation; they have to be independent of transformations of parameter , where is an analytic function of form
The formation of scalar invariants of a curve can be considered on the following examples: scalar invariants of the first order (by the highest order of the applied vector derivatives) , scalar invariants of the second order (curvature) , scalar invariants of the third order (torsion) . It is obvious that the scalar invariants of the segments have to be equal at the points of smooth connection of spline curve segments. Let us consider smooth connection of adjacent segments and of the constructed spline
Let us express in general form the scalar functions of vector arguments (derivatives) of the segments and
The scalar functions (47) and (48) are of the equivalent mathematical form, i.e., they accept the equivalent set of vector arguments (derivatives) and perform the equivalent set of mathematical operations over said arguments.
In order to achieve connections of segments and with smoothness , it is necessary to satisfy the following conditions:
In that case, the Equation (49) and the equivalence of the mathematical form of the scalar functions (47) and (48) result in the equality of values that effectively means the equality of scalar invariants at the point of connection with smoothness .
What does this mean? It means that formation of splines through smooth connection of segments described by polynomials of higher degree determines objective existence of scalar invariants of orders higher than three (as for the case of torsion) at the connection point. These invariants generate multidimensional number space of scalar invariants of segmentally formed spline curves. It has not been studied previously. To study this space for completeness and practicality is the objective of further development of the spline formation problem considered in the present paper. We believe that further study of algorithms for the formation of scalar invariants of high orders and mathematical manipulation of these invariants in the indicated space will contribute to the appearance of spline curves of a new level of quality. As for the precision of calculation of second- and third-order scalar invariants (curvature and torsion), the calculation results provided in Table 1, Table 2, Table 3, Table 4, Table 5, Table 6 and Table 7 show that it can be sufficiently high and is determined on the grounds of practicality.
Author Contributions
Conceptualization, K.P. and T.M.; Methodology, K.P.; Software, T.M.; Formal analysis, E.L.; Investigation, K.P. and T.M.; Data curation, K.P. and T.M.; Writing—original draft preparation, K.P., T.M., and E.L.; Writing—review and editing, K.P.; Visualization, T.M.; Supervision, K.P.; Project administration, E.L. and K.P. All authors have read and agreed to the published version of the manuscript.
Funding
This research received no external funding.
Conflicts of Interest
The authors declare no conflict of interest.
References
- Salomon, D. Curves and Surfaces for Computer Graphics; Springer Science+Business Media, Inc.: New York, NY, USA, 2006; pp. 11–164. [Google Scholar]
- Zhong, W.B.; Luo, X.C.; Chang, W.L.; Cai, Y.K.; Ding, F.; Liu, H.T.; Sun, Y.Z. Toolpath interpolation and smoothing for computer numerical control machining of freeform surfaces: A review. Int. J. Autom. Comput. 2020, 17, 1–16. [Google Scholar] [CrossRef]
- Sorokin, V.; Kombarov, V. Sravnenie kinematicheskix parametrov dvizheniya pri modelirovanii traektorij vy‘sokoskorostnoj CHPu obrabotki splajnami tret‘ej i pyatoj stepenej. [Comparison of the kinematic parameters of motion when modeling the trajectories of high-speed CNC machining with splines of the third and fifth degrees]. Aerosp. Eng. Technol. 2012, 8, 11–17. [Google Scholar]
- Kombarov, V.; Sorokin, V.; Fojtů, O.; Aksonov, Y.; Kryzhyvets, Y. S-curve algorithm of acceleration/deceleration with smoothlylimited jerk in high-speed equipment control tasks. MM Sci. J. 2019, 2019, 3264–3270. [Google Scholar] [CrossRef]
- Shen, X.; Xie, F.; Liu, X.J.; Xie, Z. A smooth and undistorted toolpath interpolation method for 5-DoF parallel kinematic machines. Robot. Comput. Integr. Manuf. 2019, 57, 347–356. [Google Scholar] [CrossRef]
- Mellinger, D.; Kumar, V. Minimum snap trajectory generation and control for quadrotors. In Proceedings of the 2011 IEEE International Conference on Robotics and Automation, Shanghai, China, 9–13 May 2011; pp. 2520–2525. [Google Scholar]
- Smulsky, J.J.; Smulsky, Y.J. Asteroids Apophis and 1950 DA: 1000 years orbit evolution and possible use. Horiz. Earth Sci. Res. 2012, 6, 63–97. [Google Scholar]
- Smulsky, J.J.; Smulsky, Y.J. Asteroid Apophis: Orbital Evolution and Possible Uses. Colon. Space 2014, 10, 1–17. [Google Scholar]
- Farouki, R.T. Pythagorean-Hodograph Curves: Algebra and Geometry Inserparable; Springer: Berlin/Heidelberg, Germany, 2008; pp. 323–552. [Google Scholar]
- Agoston, M.K. Computer Graphics and Geometric Modeling; Springer: London, UK, 2005; pp. 373–470. [Google Scholar]
- Shikin, E.V.; Plis, A.I. Krivy‘e i Poverxnosti na E‘Krane Komp‘Yutera [Curves and Surfaces on a Computer Screen]; Dialog-Mifi: Moscow, Russia, 1996; pp. 90–150. [Google Scholar]
- Farin, G. Curves and Surfaces for Computer Aided Geometric Design. Implementation and Algorithms, A Practical Guide, 4th ed.; Academic Press: San Diego, CA, USA, 1997; pp. 44–140. [Google Scholar]
- Farin, G.; Hoschek, J.; Kim, M.S. Handbook of Computer Aided Geometric Design; Elsevier Science B.V.: Amsterdam, The Netherlands, 2002; pp. 75–87. [Google Scholar]
- Knott, G.D. Interpolating Cubic Splines; Birkhauser: Boston, MA, USA, 1999; pp. 63–178. [Google Scholar]
- Hirz, M.; Dietrich, W.; Gfrerrer, A.; Lang, J. Integrated Computer-Aided Design in Automotive Development; Springer: Berlin/Heidelberg, Germany, 2013; pp. 86–136. [Google Scholar]
- Bartels, R.H.; Beatty, J.C.; Barsky, B.A. An Introduction to Splines for Use in Computer Graphics and Geometric Modeling; Morgan Kaufmann Publishers, Inc.: Los Altos, CA, USA, 1987; pp. 9–17. [Google Scholar]
- Kornishin, M.S.; Pajmushin, V.N.; Snigirev, V.F. Vy‘chislitel‘naya Geometriya v Zadachax Mexaniki Obolochek [Computational Geometry in Problems of Shell Mechanics]; Nauka: Moscow, Russia, 1989; pp. 28–53. [Google Scholar]
- Gallier, J. Curves and Surfaces in Geometric Modeling: Theory and Algorithms; University of Pennsylvania: Philadelphia, PA, USA, 2018; pp. 61–114. [Google Scholar]
- Rogers, D.F.; Adams, J.A. Mathematical Elements for Computer Graphics, 2nd ed.; McGraw-Hill: New York, NY, USA, 1990; pp. 247–289. [Google Scholar]
- Piegl, L.A.; Tiller, W. Curve interpolation with arbitrary and derivatives. Eng. Comput. 2000, 16, 73–79. [Google Scholar] [CrossRef]
- Marsh, D. Applied Geometry for Computer Graphics and CAD, 2nd ed.; Springer: London, UK, 2005; pp. 135–185. [Google Scholar]
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).