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).
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 2
m + 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.
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
.
Algorithm 1 For obtaining a spline curve with polynomial equations of the fifth degree of segments and has the following text form: |
Vector derivatives and at the joining point of segments and are determined based on the Formulas (9) and (10). Determine the vector coefficients in the segment equation based on the matrix (2). In this case, the boundary conditions of the segment are the given vector derivatives and at the knot and the vector derivatives and at the knot determined according to item 1. Determine the vector coefficients in the segment equation based on matrix (2). In this case, the boundary conditions of the segment are the vector derivatives and at the knot determined according to item 1 and the given vector derivatives and at the knot .
|
The values of curvature and torsion at boundary points
,
of the connected segments are listed in
Table 1.
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. 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.
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. 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.
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
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
.
Algorithm 2 For obtaining a spline curve with polynomial equations of the seventh degree of segments and has the following text form: |
Vector derivatives , , and at the joining point of segments and are determined based on the Formulas (29)–(31). Determine the vector coefficients in the segment equation based on the matrix (20). In this case, the boundary conditions of the segment are the given vector derivatives , , and at the knot and the vector derivatives , , and at the knot determined according to item 1. Determine the vector coefficients in the segment equation based on matrix (21). In this case, the boundary conditions of the segment are the vector derivatives , , and at the knot determined according to item 1 and the given vector derivatives , , and at the knot .
|
Table 5 shows the calculation results from Example 5.
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).
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.
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
.
Table 6 lists the values of curvature and torsion at the boundary points
of the connected segments, where
j = 1, …, 4.
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.
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.