Next Article in Journal
On an Anti-Torqued Vector Field on Riemannian Manifolds
Previous Article in Journal
Common Positive Solution of Two Nonlinear Matrix Equations Using Fixed Point Results
Previous Article in Special Issue
Planar Typical Bézier Curves with a Single Curvature Extremum
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Spline Approximation, Part 2: From Polynomials in the Monomial Basis to B-splines—A Derivation

1
Institute of Geodesy and Geoinformation Science, Technische Universität Berlin, 10623 Berlin, Germany
2
Section 1.2: Global Geomonitoring and Gravity Field, GFZ German Research Centre for Geosciences, 14473 Potsdam, Germany
*
Author to whom correspondence should be addressed.
Mathematics 2021, 9(18), 2198; https://doi.org/10.3390/math9182198
Submission received: 13 July 2021 / Revised: 23 August 2021 / Accepted: 25 August 2021 / Published: 8 September 2021
(This article belongs to the Special Issue Approximation Theory and Methods 2020)

Abstract

:
In a series of three articles, spline approximation is presented from a geodetic point of view. In part 1, an introduction to spline approximation of 2D curves was given and the basic methodology of spline approximation was demonstrated using splines constructed from ordinary polynomials. In this article (part 2), the notion of B-spline is explained by means of the transition from a representation of a polynomial in the monomial basis (ordinary polynomial) to the Lagrangian form, and from it to the Bernstein form, which finally yields the B-spline representation. Moreover, the direct relation between the B-spline parameters and the parameters of a polynomial in the monomial basis is derived. The numerical stability of the spline approximation approaches discussed in part 1 and in this paper, as well as the potential of splines in deformation detection, will be investigated on numerical examples in the forthcoming part 3.

1. Introduction

In engineering geodesy, the use of point clouds derived from areal measurement methods, such as terrestrial laser scanning or photogrammetry, results in the necessity to approximate them by a curve or surface that can be described using a continuous mathematical function, often by means of splines. In part 1 of a three-part series of articles, presented by Ezhov et al. [1], the basic methodology of spline approximation was shown by means of ordinary cubic polynomials concatenated under constraints for continuity, smoothness, and continuous curvature. The resulting linear adjustment problem can be solved within the Gauss-Markov model with constraints for the unknowns.
However, a starting point for advanced considerations in engineering geodesy are almost always the formulas for B-spline curves and B-spline surfaces given in the textbook by Piegl and Tiller [2] (pp. 81 and 100), where the functional values of the B-spline basis functions are recursively computed according to the formulas by de Boor [3] and Cox [4]. As these formulas have a very complex mathematical derivation, but are still very easy to use, they are mostly used like a given recipe. Attempts to explain B-splines in an illustrative way often only include explanations of the application of the de Boor’s algorithm, as, for example, in the contribution by Lowther and Shene [5]. A derivation of the B-spline with the help of quadratic Bézier spline curves was presented by Berkhahn [6] (p. 73 ff.).
In this paper, we take the spline representation presented by Ezhov et al. [1] as a starting point to derive the B-spline form by means of basis changes. This is to show the user that the de Boor’s algorithm can be interpreted as another, very elegant and numerically stable, representation of the simple and intuitive representation based on ordinary polynomials.
A brief overview of the historical development of the B-spline can be found, for example, in the textbook by Farin [7] (p. 119). He explains that the forerunner of the B-spline first appeared in a publication on approximation theory by the mathematician Lobatschewsky [8]. It was constructed as a convolution of certain probability distributions. However, at that time the term “spline” has not been introduced yet. Subsequently, in 1946, Schoenberg used B-splines in his seminal publications [9,10] for data approximation. It is commonly accepted that, with these articles, the modern representation of spline approximation began and the term “spline” was used for the first time, see the historical notes in the textbook by Schumaker [11] (p. 10). Further on, many authors dealt with the utilization and the development of the B-splines. Farin [7] (p. 119) points out that one of the most important developments in this theory was the introduction of the recurrence relations, discovered by de Boor [3], Cox [4], and Mansfield. The contribution of Mansfield to this development is mentioned by de Boor in [3]. However, the recurrence relation had already appeared in contributions by Popoviciu and Chakalov in the 1930s, see the article by de Boor and Pinkus [12] and the literature cited therein.
B-splines were later fully exploited in computer graphics. Consequently, most papers about B-splines were published in this field, see for example, the contributions by the authors Piegl and Tiller [2], Szilvasi-Nagy [13], Farin [7], and Zheng et al. [14]. However, there are several publications where B-splines were used for statistical data analysis, e.g., the contributions by Wold [15] or Anderson and Turner [16].
Applications of (B)-splines in geodesy can be traced back to 1975, when Sünkel began using them for various problems. In [17], bicubic spline functions were used for the reconstruction of functions from discrete data. In [18], the representation of geodetic integral formulas by bicubic spline functions was shown using splines constructed from ordinary cubic polynomials, see [18] (p. 10 ff.), similar to the representation used later by Ezhov et al. [1]. In [19], the local interpolation of gravity data by spline functions was derived, and in [20] (p. 18 ff.) B-splines were used for smooth surface representation. As references for the B-spline functions, the publications of Schoenberg [21], Schumaker [22], and Späth [23] are listed by Sünkel [20].
On the basis of B-splines on the line, Jekeli [24] (p. 7 ff.) showed the use of spherical B-splines for representations of functions on a sphere for geopotential modeling. Mautz et al. [25] used B-splines to develop a representation of global ionosphere maps based on B-spline wavelets. The local improvement of the International Reference Ionosphere (IRI) by means of an N-dimensional B-spline surface was developed by Koch and Schmidt [26].
The application of (B)-splines in engineering geodesy can be traced back to 1985, when Dzapo et al. [27] used cubic splines for the determination of the lengths of railroad tracks. A recent application of B-spline curves and B-spline surfaces is the approximation of 3D point cloud data, as shown e.g., by Bureick et al. [28]. Kermarrec et al. [29] applied hierarchical B-splines for the approximation of 3D point cloud data obtained from measurements with a terrestrial laser scanner. Furthermore, B-spline models play an important role in spatio-temporal deformation analysis as shown by Harmening [30].
The main goal of this paper is to present an alternative derivation of the B-spline function to the purely mathematical derivation presented by Schoenberg [9] and the recursion formulas for the B-spline function developed by de Boor [3]. This derivation is based on the transition from the representation of a polynomial in the monomial basis (ordinary polynomial) to the Lagrangian form and, from there, to the Bernstein form, which finally results in the B-spline representation. In all investigations, univariate splines are used in form of a spline function y = f ( x ) . For the derivation of the formulas, we first consider the case of interpolation. The developed formulas are then used for spline approximation using least squares adjustment.
The general interpolation problem is, to find for n + 1 given data points ( x 0 , y 0 ) , ( x 1 , y 1 ) , …, ( x n , y n ) , with x 0 < x 1 < < x n a function f : in such a way that the interpolation condition
f ( x i ) = y i ,   i = 0 , 1 , , n
is fulfilled. The choice of a suitable function f depends on the properties of the data, e.g., its smoothness or periodicity. Furthermore, the choice of f is influenced by computational aspects, i.e., the computational effort for the determination of the coefficients and numerical stability of the resulting equation system. Functions that are commonly used for interpolation are:
-
Polynomials;
-
Trigonometric functions;
-
Exponential functions;
-
Logarithmic functions;
-
Rational functions.
Ezhov et al. [1] elaborated a spline approximation using piecewise ordinary cubic polynomials. In the following, we will take a closer look at the interpolation using polynomials in different representations to bridge the gap to the B-spline representation.
In general, the set of functions for interpolating given data points consists of coefficients a i and so-called basis functions ϕ 0 ( x ) , , ϕ n ( x ) and the interpolating function is defined as a linear combination
f ( x ) = i = 0 n a i ϕ i ( x )
of these basis functions. Considering the interpolation condition (1), we obtain
f ( x i ) = i = 0 n a i ϕ i ( x i ) = y i ,   i = 0 , 1 , , n .
The simplest and most common type of interpolation uses polynomials. These polynomials can be represented in different ways, as shown by Gander [31], but all of them will give the same result for the interpolation.
To avoid excessive formula derivations and to illustrate the geometric relationships in the formula derivations, quadratic splines that consist of piecewise parabola segments are considered in the following. The generalization to splines of a higher degree is relatively straightforward.
Using the example of a parabola, we start with the representation of a polynomial in the monomial basis (ordinary polynomial) and perform the following transitions:
(i)
From ordinary polynomial to Lagrangian form (Section 2);
(ii)
From Lagrangian form to Bernstein form (Section 3);
(iii)
From Bernstein form to B-spline representation (Section 4).
The reason for the representation of a polynomial in a different basis than the well-known monomial basis applied by Ezhov et al. [1] often lies in the fact that for the computation of the polynomial coefficients equation systems result, whose solution requires less computational effort and is numerically more stable. However, it is important to understand that the change of the basis functions still results in the same interpolating polynomial for the given data, and only the representation of the polynomial changes. After the derivation of the B-spline representation, this form is used for spline approximation using least squares adjustment (Section 5). The interesting fact that the determined spline parameters can be used for a transition “backwards” from B-spline to ordinary polynomial is shown in Appendix A. The transition “forwards” from ordinary polynomial to B-spline is shown in Appendix B.

2. Transition from Ordinary Polynomial to Lagrangian Form

With the monomial basis functions
ϕ i ( x ) = x i ,   i = 0 , 1 , , n ,
we obtain for the parabola with n = 2 from (3)
P 2 ( x ) = a 0 + a 1 x + a 2 x 2 .
A polynomial in the monomial basis is often referred to as standard form or ordinary polynomial. Arranging the monomials in a vector m ( x ) = [ 1 , x , x 2 ] T and the coefficients in a vector a = [ a 0 , a 1 , a 2 ] T , we obtain
P 2 ( x ) = a T m ( x ) .
A visualization of the monomial functions for the parabola is shown in Figure 1.
Considering the interpolation condition (1), the coefficients can be determined from the solution of the linear equation system
y = V a ,
with y = [ y 0 , y 1 , y 2 ] T and the Vandermonde matrix
V = [ 1 x 0 x 0 2 1 x 1 x 1 2 1 x 2 x 2 2 ] ,
cf. the textbook by Farin [7] (p. 100). Using a numerical example with three points that define a parabola from the handbook by Bronshtein et al. [32] (p. 918), see Table 1, the determination of the coefficients will be demonstrated.
From Equation (7), we obtain for this numerical example
[ 1 3 2 ] = [ 1 0 0 1 1 1 1 3 9 ] [ a 0 a 1 a 2 ] .
This system of equations can be solved with, for example, the Gaussian elimination method and the numerical result is a 0 = 1 , a 1 = 17 6 , a 2 = 5 6 . Thus, the equation of the parabola reads
P 2 ( x ) = 1 + 17 6 x 5 6 x 2 .
It can be stated that, when using the monomial basis, the numerical effort to determine the coefficients requires roughly n 3 operations using direct methods for solving systems of linear equations, as stated e.g., by Farin [7] (p. 102), and is therefore comparably high. It can be reduced by employing iterative methods. In addition, the matrix of the equation system is increasingly ill-conditioned as the degree of the polynomial increases. Both the conditioning of the resulting linear equation system and the computational effort for determining the coefficients can be improved by using other basis functions. The result is the same interpolating polynomial, but in a different representation.
In the following subsections we will illustrate two ways how to perform a transition from the monomial basis to a representation with Lagrange polynomials.

2.1. Transition by Means of Basis Transformation

We want to solve the problem of basis transformation between two different sets of coefficients a i and b i fulfilling
P 2 ( x ) = i = 0 2 a i ϕ i ( x ) = i = 0 2 b i ψ i ( x ) ,
where ϕ i ( x ) and ψ i ( x ) are two different sets of basis functions. Using the monomial basis function (4) in the first summation formula, we obtain
P 2 ( x ) = i = 0 2 a i ϕ i ( x ) = a 0 + a 1 x + a 2 x 2 = [ a 0 a 1 a 2 ] [ 1 x x 2 ] ,
as already shown in (5) and (6). Multiplying out the second summation formula in (11) yields
P 2 ( x ) = i = 0 2 b i ψ i ( x ) = b 0 ψ 0 ( x ) + b 1 ψ 1 ( x ) + b 2 ψ 2 ( x ) = [ b 0 b 1 b 2 ] [ ψ 0 ( x ) ψ 1 ( x ) ψ 2 ( x ) ]
and, according to (11), we can write
[ a 0 a 1 a 2 ] [ 1 x x 2 ] = [ b 0 b 1 b 2 ] [ ψ 0 ( x ) ψ 1 ( x ) ψ 2 ( x ) ] .
In the case of monomial basis, we selected basis functions and obtained the coefficients, see (7), while here we do the opposite. We select b 0 = y 1 , b 1 = y 2 , b 2 = y 3 for the coefficients to obtain corresponding basis functions for which we introduce the new notation l i ( x ) with i = 0 , 1 , 2 . Furthermore, for a 0 , a 1 , a 2 we introduce the solution according to (7) and we obtain
[ y 0 y 1 y 2 ] [ 1 1 1 x 0 x 1 x 2 x 0 2 x 1 2 x 2 2 ] 1 [ 1 x x 2 ] = [ y 0 y 1 y 2 ] [ l 0 ( x ) l 1 ( x ) l 2 ( x ) ] .
By comparing the coefficients of the vectors [ y 0 y 1 y 2 ] , we see that the basis functions l i ( x ) can be computed from
[ l 0 ( x ) l 1 ( x ) l 2 ( x ) ] = [ 1 1 1 x 0 x 1 x 2 x 0 2 x 1 2 x 2 2 ] 1 [ 1 x x 2 ] .
Introducing the vector l ( x ) = [ l 0 ( x ) l 1 ( x ) l 2 ( x ) ] T yields
l ( x ) = ( V T ) 1 m ( x ) .
The same formula can also be obtained taking the basis transformation from Lagrange to monomials V T l ( x ) = m ( x ) , as presented by Gander [31], and solving it for l ( x ) . From (17), we obtain the result
l ( x ) = [ ( x x 1 ) ( x x 2 ) ( x 0 x 1 ) ( x 0 x 2 ) ( x x 0 ) ( x x 2 ) ( x 1 x 0 ) ( x 1 x 2 ) ( x x 0 ) ( x x 1 ) ( x 2 x 0 ) ( x 2 x 1 ) ] T ,
which is called the Lagrange basis. A visualization of the Lagrange basis functions for the parabola is shown in Figure 2.
Finally, the resulting polynomial reads
P 2 ( x ) = ( x x 1 ) ( x x 2 ) ( x 0 x 1 ) ( x 0 x 2 ) y 0 + ( x x 0 ) ( x x 2 ) ( x 1 x 0 ) ( x 1 x 2 ) y 1 + ( x x 0 ) ( x x 1 ) ( x 2 x 0 ) ( x 2 x 1 ) y 2 .
An alternative derivation of the Lagrange representation of a polynomial is presented in the following subsection.

2.2. Transition by Linear Combinations

In this subsection, we present an alternative derivation of the polynomial in the Lagrange representation. We use the fact that each parabola can be represented as a combination of two lines. In fact, if we take a look at (5), we find that it can be rearranged into the form f ( x ) = a 0 + ( a 1 + a 2 x ) x , which represents a combination (product) of two lines plus some constant value a 0 . By using this idea, the Lagrange representation of a quadratic polynomial can be derived, which results in a linear combination of three quadratic functions p ( x ) and the respective y i coordinates.
We consider the points ( x 0 , y 0 ) , ( x 1 , y 1 ) , ( x 2 , y 2 ) , where x 0 < x 1 < x 2 . Now two lines
f 0 , 1 ( x ) = a 0 + a 1 x
within the interval [ x 0 , x 1 ) and
f 1 , 1 ( x ) = b 0 + b 1 x
within the interval [ x 1 , x 2 ] are defined, see Figure 3. The subscripts i and d in f i , d represent the number of the polynomial i for a given degree d .
From two given points, the slope of the line (20) can be written as
a 1 = y 1 y 0 x 1 x 0 .
The y-intercept can be computed from
a 0 = y 0 x 0 y 1 y 0 x 1 x 0   or   a 0 = y 1 x 1 y 1 y 0 x 1 x 0 .
Inserting (22) and (23) into (20) yields, after some rearrangement, for the first line
f 0 , 1 ( x ) = x 1 x x 1 x 0 y 0 + x x 0 x 1 x 0 y 1 .
Analogously, the equation for the second line can be written as
f 1 , 1 ( x ) = x 2 x x 2 x 1 y 1 + x x 1 x 2 x 1 y 2 .
By taking a combination of these two line equations, where x varies within the interval [ x 0 , x 2 ] , the expression
f 0 , 2 ( x ) = x 2 x x 2 x 0 f 0 , 1 ( x ) + x x 0 x 2 x 0 f 1 , 1 ( x )
for the parabola is derived, which represents a linear combination of three quadratic polynomial functions and the coordinates y 0 , y 1 and y 2 .
To explain how the factors in front of the terms f 0 , 1 ( x ) and f 1 , 1 ( x ) in (26) are derived, the idea behind the Lagrange polynomials has to be explained. Lagrange was looking for an interpolation polynomial that could be constructed without solving a system of equations, e.g., with Vandermonde matrix as design matrix, see (7). There is a widely accepted assumption that his idea for the solution was to find a function that, at each given data point ( x 0 , y 0 ) , ( x 1 , y 1 ) , …, ( x n , y n ) , gives 1 and, at the rest of the other given points gives 0. For a mathematician, this type of polynomials was, presumably, relatively easy to find. We will take the case of a parabola into consideration. Therefore, for each given x i , the following polynomials
p x 0 ( x ) = ( x x 1 ) ( x x 2 ) ( x 0 x 1 ) ( x 0 x 2 ) ,
p x 1 ( x ) = ( x x 0 ) ( x x 2 ) ( x 1 x 0 ) ( x 1 x 2 ) ,
p x 2 ( x ) = ( x x 0 ) ( x x 1 ) ( x 2 x 0 ) ( x 2 x 1 )
can be created.
As previously mentioned, these functions p x i ( x ) are equal to 1 when the variable x is equal to the corresponding coordinate x i of the given point and 0 at all other given points. Therefore, by multiplying each of these functions p x i ( x ) with their corresponding values y i ensures that, at the particular given point x i , the result will be y i and 0 at all other given points. The summation of all these functions p x i ( x ) , multiplied by their corresponding values y i , results in a Lagrangian interpolation polynomial
f ( x ) = ( x x 1 ) ( x x 2 ) ( x 0 x 1 ) ( x 0 x 2 ) y 0 + ( x x 0 ) ( x x 2 ) ( x 1 x 0 ) ( x 1 x 2 ) y 1 + ( x x 0 ) ( x x 1 ) ( x 2 x 0 ) ( x 2 x 1 ) y 2 .
The quadratic polynomial (30) represents a linear combination of the Lagrangian basis polynomials with the constants y 0 , y 1 and y 2 as coefficients. A general formula for the definition of the Lagrange interpolation polynomials can be found e.g., in the handbook by Bronshtein et al. [32] (p. 918).
As previously explained, a quadratic polynomial can be represented as a combination of two lines. Using the Lagrangian form for a polynomial of first order, the following two line equations
f 0 , 1 ( x ) = x x 1 x 0 x 1 y 0 + x x 0 x 1 x 0 y 1 ,
f 1 , 1 ( x ) = x x 2 x 1 x 2 y 1 + x x 1 x 2 x 1 y 2
are derived. If we follow the already described Lagrange’s idea to obtain a quadratic polynomial, the following multiplications
f 0 , 2 ( x ) = x x 2 x 0 x 2 f 0 , 1 ( x ) + x x 0 x 2 x 0 f 1 , 1 ( x )
must be performed.
Consequently, Equation (33) results in a Lagrangian polynomial of second order. Looking at (33), the factors ( x x 2 ) / ( x 0 x 2 ) and ( x x 0 ) / ( x 2 x 0 ) are those that appear in front of the terms f 0 , 1 ( x ) and f 1 , 1 ( x ) in (26). However, if we compare the Lagrange polynomials in (31), (32), (33) with the expressions in (24), (25), (26), the only difference is that (31), (32) and (33) have negative denominators and numerators at some points in the Lagrange polynomials, e.g. ( x x 2 ) / ( x 0 x 2 ) . In (24), (25) and (26) there are no negative denominators or numerators, although the equations are the same as in (31), (32) and (33). This is for reasons of better analogy with the B-spline form.
After the origin of the factors in front of f 0 , 1 ( x ) and f 1 , 1 ( x ) in (26) is explained, inserting (24) and (25) into (26) finally yields
f 0 , 2 ( x ) = ( x 1 x ) ( x 2 x ) ( x 1 x 0 ) ( x 2 x 0 ) y 0 + ( x x 0 ) ( x 2 x ) ( x 1 x 0 ) ( x 2 x 1 ) y 1 + ( x x 0 ) ( x x 1 ) ( x 2 x 0 ) ( x 2 x 1 ) y 2 .
This form coincides with (19) and represents a second degree Lagrange interpolating polynomial through three points, see the handbook by Bronshtein et al. [32] (p. 918). The plot of the parabola is depicted in Figure 4.
Inserting the values of the numerical example from Table 1 into (34) yields the Lagrangian form
f 0 , 2 ( x ) = ( 1 x ) ( 3 x ) ( 1 0 ) ( 3 0 ) 1 + ( x 0 ) ( 3 x ) ( 1 0 ) ( 3 1 ) 3 + ( x 0 ) ( x 1 ) ( 3 0 ) ( 3 1 ) 2 ,
which can be “simplified” to the monomial basis form
f 0 , 2 ( x ) = 1 + 17 6 x 5 6 x 2 .
The result is the same as in (10), but the values of the parameters a 0 , a 1 , a 2 are now derived with the advantage of not explicitly solving a linear equation system. A disadvantage of Lagrange interpolation in practical application is directly visible from (19), resp. (34), namely that each time a value x changes, the Lagrange basis polynomials must be recalculated. Further general limits of Lagrange interpolation, e.g., that polynomial interpolants may oscillate, are explained by Farin [7] (p. 101 ff.).

3. Transition from Lagrangian Form to Bernstein Form

The Bernstein form, named after S. N. Bernstein, was used to prove the Weierstrass approximation theorem; see the explanation by Farin [7] (p. 90 ff.). The coefficients of a Bernstein polynomial over the interval [0, 1] are all non-negative and sum up to 1, as Farin [7] (p. 57 ff.) showed, which is called a convex combination; see the textbook by Rockafellar [33] (p. 11). Therefore, by using the Bernstein form, numerical instabilities are avoided.
Looking at Figure 3, the interpolating parts of the line segments can be extended to both ends of the interval [ x 0 , x 2 ] in which the polynomial is defined. At the end of the extended line segments, two additional y-coordinates for the values x 0 and x 2 are computed, as seen in Figure 5. To distinguish these two y-coordinates from the given values, a different notation, y 0 and y 2 , is used (not to be confused with the derivation of a function). In a general case, all five points have different coordinates which implies that the coordinate x 1 is not necessarily in the middle of the interval [ x 0 , x 2 ] . Therefore, in general x 1 ( x 0 + x 2 ) / 2 .
From Figure 5, as explained previously, the line equations
f 0 , 1 ( x ) = x 2 x x 2 x 0 y 0 + x x 0 x 2 x 0 y 2 ,   f 1 , 1 ( x ) = x 2 x x 2 x 0 y 0 + x x 0 x 2 x 0 y 2
are derived. By taking combinations of these two lines, it follows
f 0 , 2 ( x ) = ( x 2 x x 2 x 0 ) 2 y 0 + x 2 x x 2 x 0 x x 0 x 2 x 0 y 2 + x x 0 x 2 x 0 x 2 x x 2 x 0 y 0 + ( x x 0 x 2 x 0 ) 2 y 2 ,
which can be brought into the form
f 0 , 2 ( x ) = ( x 2 x x 2 x 0 ) 2 y 0 + 2 x 2 x x 2 x 0 x x 0 x 2 x 0 ( y 2 + y 0 2 ) + ( x x 0 x 2 x 0 ) 2 y 2 .
A geometrical interpretation of the term ( y 2 + y 0 ) / 2 is depicted in Figure 6.
Equation (39) is a more general representation of the Bernstein form, independent of the limits of the interval [ x 0 , x 2 ] , which means that x can vary between any two real values. For proving the Weierstrass approximation theorem, Bernstein used a special interval of length 1, i.e., [ x 0 , x 2 ] = [ 0 , 1 ] . Using this interval simplifies the equations, which were later used by Bézier and de Casteljau. Therefore, when using [ x 0 , x 2 ] = [ 0 , 1 ] , Equation (37) results in
f 0 , 1 ( x ) = ( 1 x ) y 0 + x y 2 ,   f 1 , 1 ( x ) = ( 1 x ) y 0 + x y 2
and (39) obtains the form
f 0 , 2 ( x ) = ( 1 x ) 2 y 0 + 2 x ( 1 x ) ( y 2 + y 0 2 ) + x 2 y 2 ,
in which ( 1 x ) 2 , 2 x ( 1 x ) and x 2 are the Bernstein basis polynomials and y 0 , ( y 2 + y 0 ) / 2 and y 2 are the Bernstein coefficients. In general, a polynomial in Bernstein form of degree n can be written as
P n ( x ) = i = 0 n β i B i , n ( x ) ,
where β i are the Bernstein coefficients and
B i , n ( x ) = ( n i ) x i ( 1 x ) n i ,   i = 0 , 1 , , n
are the Bernstein basis polynomials; see e.g., the handbook by Bronshtein et al. [32] (p. 935). For a parabola, we obtain B 0 , 2 = ( 1 x ) 2 , B 1 , 2 = 2 x ( 1 x ) and B 2 , 2 = x 2 , cf. (41). These basis polynomials for a parabola are depicted in Figure 7.
In (39), the term ( y 2 + y 0 ) / 2 , see Figure 6, reveals one fundamental property of the quadratic polynomial that, to the best of our knowledge, is not described in the literature so far. It can be stated as:
All pairs of line segments that have one end fixed at the beginning or at the end of the parabola and the other end at the opposite sides of the interval, and intersect themselves on the parabola, have an equal average of the coordinates at the ends that are not fixed. Moreover, the extremum of the parabola lies on the intersection of those line segments that have equal values at the opposite ends of the interval.
The proof of this statement is straightforward. A parabola is uniquely defined by three points. If we retain end points ( x 0 , y 0 ) and ( x 2 , y 2 ) , replacing the point ( x 1 , y 1 ) by any other point on the same parabola, we will again obtain the equation of the form (39). The equation of the parabola remains unchanged although y 0 and y 2 have changed, since the only term depending on the new point is ( y 0 + y 2 ) / 2 . A parabola is described by a differentiable function. By computing its derivative, equating it with zero and solving the resulting equation for x , we obtain the coordinate of the extremum x e . Consequently, the resulting equation for the coordinate of the extremum y e can be solved. By substituting these two values for x e and y e in a line equation constructed for y 0 and y 2 , where x = x 0 and x = x 2 respectively, it can be shown that y 0 = y 2 = C y . Therefore, y 0 y 2 implies C y = ( y 0 + y 2 ) / 2 . This proves the above statement, which is illustrated in Figure 8. M and N represent the fixed points at the beginning and at the end of the parabola, with m 1 , , m 6 and n 1 , , n 6 as end points at the opposite sides of the interval. Every pair of line segments is defined as ( M n 0 ¯ , N M ¯ ) , ( M n 1 ¯ , N m 1 ¯ ) , ( M n 2 ¯ , N m 2 ¯ ) , …, ( M N ¯ , N m 6 ¯ ) and depicted in light blue color. Figure 8 illustrates that all these pairs of line segments intersect on the parabola.
Considering the above, there are an infinite number of combinations defining the term ( y 2 + y 0 ) / 2 depending on the position of the point ( x 1 , y 1 ) , between M and N , that defines the parabola, cf. Figure 6. All of these pairs of line segments, as previously explained, have an equal average of the y-coordinates at the end points. Therefore, the term that uniquely represents all these averages is written more generally in the form
C y = y m + y n 2 ,
where y m and y n represent any pair of y -coordinates from the mentioned line segments that intersect on the parabola. Correspondingly, the coordinate C x is defined as
C x = x i + x i + 1 2 ,
where x i and x i + 1 define the ends of the interval in which the parabola varies. Hence, C x is always in the middle of the interval.
There is an additional property of the line segments M n 0 ¯ and N m 6 ¯ . They intersect at the point ( C x , C y ) and are tangential to the curve. This can be easily proven. We can compute the first derivative and solve for y m and y n from (44), then construct two line equations for ( x 0 , y 0 ) ( x 2 , y n ) ¯ and ( x 0 , y m ) ( x 2 , y 2 ) ¯ and solve for their intersection.
In the context of geometric modelling, the point defined by ( C x , C y ) is called control point and, concerning basis splines (B-splines), it is named de-Boor-point. In Figure 8, this point is marked with a blue dot. Moreover, the first and the last point of the parabola are also referred to as control points, see e.g., the textbook by Piegl and Tiller [2] (pp. 389–390).
With (44), the general form of (39) can be written as
f 0 , 2 ( x ) = ( x 2 x x 2 x 0 ) 2 y 0 + 2 x 2 x x 2 x 0 x x 0 x 2 x 0 C y + ( x x 0 x 2 x 0 ) 2 y 2 .
As a more general representation of the Bernstein polynomial, (46) is a convex combination as well. The proof is obvious. Since x 0 < x 2 , all functions in front of y 0 , C y and y 2 are non-negative and have a sum of 1. The control points ( x 0 , y 0 ) , ( C x , C y ) and ( x 2 , y 2 ) form a convex hull, highlighted in grey in Figure 8, that encloses all realizations of x in (46), which means that all points of the parabola lie within the convex hull. A convex hull is the smallest convex set that contains a given set, with a convex set being a set wherein the straight line segment, connecting any two points of the set is completely contained within the set; see e.g., the textbook by Farin [7] (p. 439). The advantage of the general representation of the Bernstein polynomial is that it can be applied directly without scaling the data set to the interval [ x 0 , x 2 ] = [ 0 , 1 ] .
If we now consider the example from Table 1 once again, we get, with y 0 = 3.5 and y 2 = 7.0 , from (44) the result C y = 5.25 and therefore
f 0 , 2 ( x ) = ( 3 x 3 0 ) 2 1 + 2 3 x 3 0 x 0 3 0 5.25 + ( x 0 3 0 ) 2 2 ,
which can be “simplified” to the monomial basis form
f 0 , 2 ( x ) = 1 + 17 6 x 5 6 x 2 .
This is of course the same as (10) and (36).
For the case of the interpolation by a parabola, it can be concluded that both the Bernstein and the Lagrangian form yield the same result. However, the Bernstein form has the advantage that all points of the parabola lie in the convex hull defined by its parameters.

4. Transition from Bernstein Form to B-spline

In the previous section, the Bernstein form was derived with a more general approach, instead of the standard representation within the interval [ 0 , 1 ] . This form can be easily used for derivation of the B-spline.
In this section, Equation (46) is used for further derivations. It is assumed that the line segments that define the quadratic polynomial intersect at the extremum of the parabola and have an identical coordinate C y i . Since the notion of spline is to be explained, only the endpoints of two smoothly connected parabolas are considered, which are better known as knots ( x 0 , y 0 ) , ( x 1 , y 1 ) and ( x 2 , y 2 ) . The problem of the constraints and how they are imposed on the spline, for spline interpolation, is not taken into consideration. It is presumed that the first parabola of the spline is already defined, e.g., by imposing a constraint for the direction of the tangent in point x 0 as boundary condition, and in this case, is identical with the one from the previous section, see Figure 8.
The initial situation is depicted in Figure 9, where:
-
One parabola already exists between the knots ( x 0 , y 0 ) and ( x 1 , y 1 ) ; and
-
One knot ( x 2 , y 2 ) is given that is to be interpolated.
The task is now to construct a second parabola between the knots ( x 1 , y 1 ) and ( x 2 , y 2 ) which is tangential to the first one.
The second parabola is constructed as follows:
-
The line segment ( x 0 , C y 1 ) ( x 1 , y 1 ) ¯ is extended from the end point ( x 1 , y 1 ) of the parabola to the end of the interval [ x 1 , x 2 ] , yielding the additional coordinates ( x 2 , C y 2 ) and therefore the new line segment ( x 1 , y 1 ) ( x 2 , C y 2 ) ¯ , see Figure 10;
-
Between points ( x 1 , C y 2 ) and ( x 2 , y 2 ) , the line segment ( x 1 , C y 2 ) ( x 2 , y 2 ) ¯ can be constructed, see Figure 11;
-
By taking combinations of these two line segments, within the interval [ x 1 , x 2 ] , another parabola will be constructed, smoothly connected to the previous one. The whole function constructed from these two smoothly connected parabolas represents a spline. Both parabolas end tangentially at the point ( x 1 , y 1 ) w.r.t the line segment, defined as ( C x 1 , C y 1 ) ( C x 2 , C y 2 ) ¯ , see Figure 12.
Finally, this is a type of spline that is constructed by using convex combinations and it is exactly the same as the B-spline. This is shown by the equations derived further in the text. Algebraically, this derivation is similar to the one in the previous section. The first pair of line equations is written as
f 0 , 1 ( x ) = x 1 x x 1 x 0 y 0 + x x 0 x 1 x 0 C y 1 ,   f 1 , 1 ( x ) = x 2 x x 2 x 0 C y 1 + x x 0 x 2 x 0 C y 2 .
By taking a combination of these two lines within the interval [ x 0 , x 1 ] , it follows
f 0 , 2 ( x ) = ( x 1 x x 1 x 0 ) 2 y 0 + ( x 1 x x 1 x 0 x x 0 x 1 x 0 + x x 0 x 1 x 0 x 2 x x 2 x 0 ) C y 1 + ( x x 0 ) 2 ( x 2 x 0 ) ( x 1 x 0 ) C y 2
For the second parabola the same approach is applied. The second pair of line equations is defined in the same way as the previous one, yielding
f 2 , 1 ( x ) = x 2 x x 2 x 0 C y 1 + x x 0 x 2 x 0 C y 2 ,   f 3 , 1 ( x ) = x 2 x x 2 x 1 C y 2 + x x 1 x 2 x 1 y 2 .
Analogously to (50), but in this case within the interval [ x 1 , x 2 ] , we obtain
f 1 , 2 ( x ) = x 2 x x 2 x 1 x 2 x x 2 x 0 C y 1 + ( x 2 x x 2 x 1 x x 0 x 2 x 0 + x x 1 x 2 x 1 x 2 x x 2 x 1 ) C y 2 + ( x x 1 x 2 x 1 ) 2 y 2 .
If the above derived expressions are compared to an explicit expression of a quadratic B-spline it becomes clear that they are the same. However, for the sake of clarity we have used a particular notation that does not correspond to the usual B-spline notation.
Looking at (50) and (52), the only unknowns are C y 1 and C y 2 , all other values are given. It appears that a quadratic spline, constructed from two linear polynomials, can be estimated with only two equations. This type of reasoning would lead to a paradox. Therefore, for this type of a spline, since all constraints (smoothness and continuity) are hidden inside the equations, at least four observations are necessary for a solution. For comparison, a spline constructed from two polynomials of the form a 0 + a 1 x + a 2 x 2 requires at least three observations and three constraints.
The idea presented in this section can be used for constructing splines of higher degrees as well. In those cases, depending on the degree of the spline, one would need more knots and more control points for creating a spline segment, while the number of combinations increases. Moreover, the expressions became more complicated, which makes this approach unsuitable for practical applications. However, de Boor [3] developed an algorithm for computing the basis functions that, in our case, constructs the expressions in front of the coordinates of the control points in (50) and (52).
De Boor’s algorithm is based on the Cox-de Boor recursion formula that we will use for explaining the computation of a B-Spline. Recursion itself is non-intuitive, which makes this formula difficult to be explained analytically. The higher the degree of the spline, the more cumbersome and harder to follow the equations become. Therefore, in order to make a comparison with (50) and (52), we will use an explicit expression of a quadratic B-spline that is derived from the Cox-de Boor recursion formula. For this purpose, we use the knots and the naming convention from the previous example (49)–(52). For this formula to work, we have to rename the parameters (control points) y 0 to C y 0 and y 2 to C y 3 . The Cox-de Boor recursion requires additional knots at the beginning and at the end of the spline based on the degree of the spline. If the spline degree is d = 2 , two additional knots are presumed to be both at the beginning and at the end of the spline. In our case, they are
x 2 , x 1   and x 3 , x 4 ,
which is called knot multiplication. Additional knots with e.g.,
x 2 = x 1 = x 0   and   x 2 = x 3 = x 4
are especially used to gain endpoint interpolation. The additional knots do not necessarily have to be equal to x 0 and x 2 , they are just required to follow the order x 2 x 1   x 0 and x 2 x 3   x 4 . However, in our example we follow the convention of the knot multiplication, and because of the knot multiplication, formula (56) has zero divisions, and the solution for this problem is to declare that “anything divided by zero is equal to zero”.
The base case of the recursion formula is
B i , 0 ( x ) = { 1 ,   x i x < x i + 1 , 0 ,   otherwise ,
with a recursive step to compute the basis functions
B i , d ( x ) = x x i x i + d x i B i , d 1 ( x ) + x i + d + 1 x x i + d + 1 x i + 1 B i + 1 , d 1 ( x ) ,
which is summed over the k-th interval of the spline f k , d ( x ) , such as
f k , d ( x ) = i = k d k C y i + d B i , d ( x ) .
At the beginning of the recursion (56), index d denotes the degree of the spline and i is a computed index i = k d , , k . In each recursive step, d is lowered down for 1 until it reaches 0. At d = 0 , the recursion formula terminates and the base case (55) is evaluated.
The index k is the index of the interval [ x k , x k + 1 ] with k = 0 , 1 , , l 1 , where l is the number of knots. Therefore, for k = 0 , the recursion formula (56) is computed for every i of the sum (57) and evaluated in (55). Afterwards, for k = 1 , the same computation is performed, and so on, until the last interval. The parameters C y i in (57) correspond to each basis function terminated by B i , 0 ( x ) in (55) at the end of the recursion. An example of quadratic basis functions using the knots x k 0 = 0 , x k 1 = 1 and x k 2 = 3 , resulting in two intervals k = 0 and k = 1 , and the knot sequence [ 0 , 0 , 0 , 1 , 3 , 3 , 3 ] , is shown in Figure 13.
To compare this approach with (50) and (52), we use an explicit expression of a generic quadratic B-spline formula. For deriving it, we consider d = 2 in (56), then we follow all recursive steps until d = 0 for every B i , d ( x ) , which yields the explicit expression of a generic quadratic B-spline formula
B i , 2 ( x ) = ( x x i ) 2 ( x i + 2 x i ) ( x i + 1 x i ) B i , 0 ( x ) + ( x i + 3 x ) 2 ( x i + 3 x i + 1 ) ( x i + 3 x i + 2 ) B i + 2 , 0 ( x ) + ( ( x x i ) ( x i + 2 x ) ( x i + 2 x i ) ( x i + 2 x i + 1 ) + ( x i + 3 x ) ( x x i + 1 ) ( x i + 3 x i + 1 ) ( x i + 2 x i + 1 ) ) B i + 1 , 0 ( x ) .
For clearer description, we treat each part of (57) separately and, for the computation, we use the knot sequence (53). At the interval k = 0 , with index i = 2 , the first element of the sum is
C y 0 B 2 , 2 ( x ) = C y 0 [ ( x x 2 ) 2 ( x 0 x 2 ) ( x 1 x 2 ) B 2 , 0 ( x ) + ( x 1 x ) 2 ( x 1 x 1 ) ( x 1 x 0 ) B 0 , 0 ( x ) + ( ( x x 2 ) ( x 0 x ) ( x 0 x 2 ) ( x 0 x 1 ) + ( x 1 x ) ( x x 1 ) ( x 1 x 1 ) ( x 0 x 1 ) ) B 1 , 0 ( x ) ] .
With i = 1 , the second element of the sum is
C y 1 B 1 , 2 ( x ) = C y 1 [ ( x x 1 ) 2 ( x 1 x 1 ) ( x 0 x 1 ) B 1 , 0 ( x ) + ( x 2 x ) 2 ( x 2 x 0 ) ( x 2 x 1 ) B 1 , 0 ( x ) + ( ( x x 1 ) ( x 1 x ) ( x 1 x 1 ) ( x 1 x 0 ) + ( x 2 x ) ( x x 0 ) ( x 2 x 0 ) ( x 1 x 0 ) ) B 0 , 0 ( x ) ]
and, with i = 0 , the last element of the sum is
C y 2 B 0 , 2 ( x ) = C y 2 [ ( x x 0 ) 2 ( x 2 x 0 ) ( x 1 x 0 ) B 0 , 0 ( x ) + ( x 3 x ) 2 ( x 3 x 1 ) ( x 3 x 2 ) B 2 , 0 ( x ) + ( ( x x 0 ) ( x 2 x ) ( x 2 x 0 ) ( x 2 x 1 ) + ( x 3 x ) ( x x 1 ) ( x 3 x 1 ) ( x 2 x 1 ) ) B 1 , 0 ( x ) ] .
Taking the knot multiplications (53) and (54) into account for all elements of the sums (59)–(61) yields
C y 0 B 2 , 2 ( x ) = C y 0 [ ( x x 0 ) 2 ( x 0 x 0 ) ( x 0 x 0 ) B 2 , 0 ( x ) + ( x 1 x ) 2 ( x 1 x 0 ) ( x 1 x 0 ) B 0 , 0 ( x ) + ( ( x x 0 ) ( x 0 x ) ( x 0 x 0 ) ( x 0 x 0 ) + ( x 1 x ) ( x x 0 ) ( x 1 x 0 ) ( x 0 x 0 ) ) B 1 , 0 ( x ) ] ,
C y 1 B 1 , 2 ( x ) = C y 1 [ ( x x 0 ) 2 ( x 1 x 0 ) ( x 0 x 0 ) B 1 , 0 ( x ) + ( x 2 x ) 2 ( x 2 x 0 ) ( x 2 x 1 ) B 1 , 0 ( x ) + ( ( x x 0 ) ( x 1 x ) ( x 1 x 0 ) ( x 1 x 0 ) + ( x 2 x ) ( x x 0 ) ( x 2 x 0 ) ( x 1 x 0 ) ) B 0 , 0 ( x ) ] ,
C y 2 B 0 , 2 ( x ) = C y 2 [ ( x x 0 ) 2 ( x 2 x 0 ) ( x 1 x 0 ) B 0 , 0 ( x ) + ( x 2 x ) 2 ( x 2 x 1 ) ( x 2 x 2 ) B 2 , 0 ( x ) + ( ( x x 0 ) ( x 2 x ) ( x 2 x 0 ) ( x 2 x 1 ) + ( x 2 x ) ( x x 1 ) ( x 2 x 1 ) ( x 2 x 1 ) ) B 1 , 0 ( x ) ] .
The base case (55) evaluates only the functions in front of B 0 , 0 ( x ) , all other base functions are not taken into consideration nor are the fractions where division by zero occurred. Finally, by summing up all results (62), (63) and (64) for the first interval, as stated in (57), and evaluating by (55), we obtain
f 0 , 2 ( x ) = i = 2 0 C y i + 2 B i , 2 ( x ) = ( x 1 x ) 2 ( x 1 x 0 ) ( x 1 x 0 ) C y 0 + ( ( x x 0 ) ( x 1 x ) ( x 1 x 0 ) ( x 1 x 0 ) + ( x 2 x ) ( x x 0 ) ( x 2 x 0 ) ( x 1 x 0 ) ) C y 1 + ( x x 0 ) 2 ( x 2 x 0 ) ( x 1 x 0 ) C y 2 .
If Equation (65) is compared to (50), it can be concluded that they are identical. It must just be taken into consideration, as stated previously, that y 0 is renamed to C y 0 . If the same procedure is applied to k = 1 , the result is identical to (52), considering that y 2 is renamed to C y 3 .
Since spline functions y = f ( x ) are considered, only the component C y i of a control point ( C x i , C y i ) appears as a factor in front of the basis functions B i , d ( x ) . Using a parametric spline curve, both components of a control point appear in front of the basis functions as e.g., applied by Bureick et al. [34].
The Cox-de Boor recursion Formulas (55) and (56) are the basis of the de Boor’s algorithm. The presented functions in front of the parameters are called basis functions and the curve is called B-spline curve.

5. B-spline Approximation

As pointed out by Ezhov et al. [1], in engineering geodesy it is not appropriate to apply a spline interpolation due to the high point density and the fact that measurements are affected by random measurement errors. Observation errors and other abrupt changes in the data points would be modeled, resulting in a strongly oscillating spline. The solution to this is to divide the sequence of points into not so many intervals, determined by predefined knots. The distribution of the knots is a fundamental problem in spline approximation and different knot placement strategies can be applied to solve it, as explained by Ezhov et al. [1]. Within the resulting intervals, we consider an overdetermined configuration and, hence, the parameters of a B-spline can be computed by least squares adjustment.
Since the Cox-de Boor Formulas (55)–(57) manage the whole process of computing the coefficients of the unknowns, the approximation can be performed with a simple linear functional model. Here, we consider quadratic splines that consist of piecewise parabolic segments. A generalization to splines of higher degree is straightforward.

5.1. Definition of the Problem

Let:
-
y 0 , y 1 , , y j , , y m be a sequence of observed values;
-
Σ L L = σ 0 2 Q L L be the variance-covariance matrix of the observations y j ;
-
x 0 < x 1 < < x j < < x m be a sequence of non-decreasing error-free values referring to the observations;
-
x k 0 < < x k n 1 be a non-decreasing sequence of user-defined values for the knots on the x-axis which are regarded as error-free.
To determine:
-
C y 0 , C y 1 , , C y n , which represent the y-component of the control “points” of the quadratic B-spline.
After defining these quantities, we can create a spline approximation from an overdetermined configuration using the Gauss-Markov model.

5.2. Formulation of the Adjustment Problem

The observation equations are of the same form for each quadratic polynomial within a spline. This is a consequence of the Cox-de Boor recursion formula. This approach (55), (56) and (57) determines to which interval a value x j belongs. One has to consider that the knot sequence must be given in advance.
Considering x j as fixed values, yields also B i , d ( x ) , computed from (55), (56), and (57), as fixed values. Here, we assume that B i , 2 ( x ) corresponds to the given parameter C y i . Explaining the observation equations explicitly by means of the Cox-de Boor’s formula is too cumbersome. Hence, with y j as observations, the observation equations
y 0 + v 0 = i = 1 n C ^ y i B i , 2 ( x 0 ) , y 1 + v 1 = i = 1 n C ^ y i B i , 2 ( x 1 ) , y m + v m = i = 1 n C ^ y i B i , 2 ( x m )
can be set up. The observation vector
L = [ y 0 y 1 y 2 y m ] T
contains all observations, while the vector of unknown parameters can be written as
X ^ = [ C ^ y 0 C ^ y 1 C ^ y n ] T .
From the stochastic model
Σ L L = σ 0 2 Q L L ,
with σ 0 2 as theoretical variance factor, the corresponding weight matrix is obtained from
P = Q L L 1 ,
supposing the cofactor matrix to be non-singular. By looking at the observation Equation (66), it is obvious that this spline approximation problem is linear and, hence, can easily be written in matrix notation
L + v = A X ^ ,
where A is the design matrix that contains the coefficients of the unknowns. Equation (71), together with (69), is denoted as Gauss-Markov model; see e.g., the textbook by Niemeier [35] (p. 137). Considering the sequence of the unknowns in (68), the design matrix reads
A = [ B 0 , 2 ( x 0 ) B 1 , 2 ( x 0 ) B n , 2 ( x 0 ) B 0 , 2 ( x 1 ) B 1 , 2 ( x 1 ) B n , 2 ( x 1 ) B 0 , 2 ( x m ) B 1 , 2 ( x m ) B n , 2 ( x m ) ] .
Even though the construction of this matrix is quite trivial, the presence of the basis functions makes it rather unusual. However, with the derivations in Section 4, it is at least clear how these basis functions can be obtained. Looking at the notation in (72), one might be misled that A is a full matrix, which is not the case. To put it simply, the Cox-de Boor formula evaluates only those x j that belong to a particular interval and everything else is equal to zero.

5.3. Least Squares Adjustment

One feature of the B-splines is that constraints for continuity, smoothness and continuity of curvature are accounted for implicitly in the functional model. Therefore, no additional constraints have to be introduced and the least squares solution for the unknowns can be obtained from
X ^ = ( A T P A ) 1 A T P L .
With the residuals
v = A X ^ L
from (71), the a posteriori estimate of the reference standard deviation
s 0 = v T P v r
can be computed, where r is the redundancy of the adjustment problem. Further details on the a posteriori analysis of adjustment results and on knot placement strategies can be found in the article by Ezhov et al. [1]. The fact that the solution for the unknowns (68) can be used for a transition “backwards” from B-spline to ordinary polynomial is shown in Appendix A.

6. Conclusions and Outlook

In engineering geodesy, point clouds derived from areal measurement methods, such as terrestrial laser scanning or photogrammetry, are often approximated by a continuous mathematical function for further analysis, such as deformation monitoring. In many cases, the formulas for B-spline curves and B-spline surfaces, given in the textbook by Piegl and Tiller [2] (pp. 81 and 100), are applied, where the functional values of the B-spline basis functions are recursively computed according to the formulas by de Boor [3] and Cox [4]. This approach is very easy to handle and results in a numerically stable solution for the unknowns to be determined. As these formulas have a very complex mathematical derivation, but are still very easy to use, they are mostly used like a given recipe without a deeper understanding of their derivation.
In part 1 of a series of three articles, Ezhov et al. [1] explained the basic methodology of spline approximation using splines constructed from ordinary polynomials. In this paper (part 2) the goal was to develop an alternative derivation of the B-spline. To avoid excessive formula derivations and to illustrate the geometric relationships, quadratic splines were considered that consist of piecewise parabolic segments. Starting with the representation of a parabola in the monomial basis (ordinary polynomial) a transition to the Langrangian form was performed and, from there, to the Bernstein form, which finally resulted in the B-spline representation. In all investigations univariate splines were used, in the form of a spline function y = f ( x ) .
For the derivation of the formulas, we first considered the case of interpolation. The developed formulas were then used for spline approximation by means of least squares adjustment. With the values y i as observations and x i as error-free values, the resulting linear adjustment problem could be solved within the Gauss-Markov model. Finally, in Appendix A it was shown that the determined spline parameters can be used for a transition “backwards” from B-spline to ordinary polynomial. The transition “forwards” from ordinary polynomial to B-spline was shown in Appendix B.
The more general case, where both values y i and x i are introduced as observations into an approximation with a spline function, was already elaborated by Neitzel et al. [36]. Investigations of the numerical stability of the spline approximation approaches, based on ordinary polynomials and on truncated polynomials, discussed in part 1 and the B-splines explained in this article, as well as the potential of splines in deformation detection, will be presented in a forthcoming part 3 of this series of three articles.

Author Contributions

Conceptualization, F.N. and S.P.; methodology, N.E.; writing—original draft preparation, F.N. and N.E.; writing—review and editing, F.N. and S.P. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Acknowledgments

The authors acknowledge support from the German Research Foundation and the Open Access Publication Fund of TU Berlin.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A. Transition from B-spline to Ordinary Polynomial

Through Section 2, Section 3 and Section 4, it was explained how a constituent part of the B-spline can be derived from an ordinary second-degree polynomial. In Appendix A, the parameters of an ordinary second-degree spline are to be expressed as functions of the B-spline parameters. We consider the following case, cf. Figure 12:
-
Three given points ( x 0 , y 0 ) , ( x 1 , y 1 ) , ( x 2 , y 2 ) are to be interpolated by a quadratic spline;
-
using the given B-spline parameters C y 1 , C y 2 , i.e., the y-component of the control points.
Since the parameters of each polynomial of an ordinary second-degree spline are derived in the same way, in the text that follows, only the derivation of the first polynomial that varies within the interval [ x 0 , x 1 ] is described.
From the line segments ( x 0 , y 0 ) ( x 1 , C y 1 ) ¯ and ( x 0 , C y 1 ) ( x 2 , C y 2 ) ¯ , see Figure 12, two line equations of the form f 0 , 1 ( x ) = a 0 + a 1 x resp. f 1 , 1 ( x ) = b 0 + b 1 x can be derived. From (49), the slope for the first line equation is
a 1 = C y 1 y 0 x 1 x 0
and the y-intercept is
a 0 = y 0 x 0 C y 1 y 0 x 1 x 0 .
Analogously, the parameters for the second line equation are
b 1 = C y 2 C y 1 x 2 x 0
and
b 0 = C y 1 x 0 C y 2 C y 1 x 2 x 0 .
The spline segment of the form of a second degree polynomial is derived by taking a combination
f 0 , 2 ( x ) = x 1 x x 1 x 0 ( a 0 + a 1 x ) + x x 0 x 1 x 0 ( b 0 + b 1 x )
of these two lines in the same way as in (50). Since x is the variable, after some rearrangement, the coefficients in front of the variable can be expressed as
f 0 , 2 ( x ) = a 0 x 1 b 0 x 0 x 1 x 0 + ( b 0 a 0 + a 1 x 1 b 1 x 0 x 1 x 0 ) x + ( b 1 a 1 x 1 x 0 ) x 2 .
The derived coefficients of the polynomial that varies within the interval [ x 0 , x 1 ] read
A 0 = a 0 x 1 b 0 x 0 x 1 x 0 ,   A 1 = b 0 a 0 + a 1 x 1 b 1 x 0 x 1 x 0 ,   A 2 = b 1 a 1 x 1 x 0 .
By inserting the terms from (A7) into (A6), we obtain the ordinary second-degree polynomial
f 0 , 2 ( x ) = A 0 + A 1 x + A 2 x 2 .
Only the interval [ x 0 , x 1 ] is considered as the domain of the definition of the spline. The parameters of the ordinary second-degree polynomial, which varies within the interval [ x 1 , x 2 ] , can be derived analogously to the first one and would take the form
f 1 , 2 ( x ) = B 0 + B 1 x + B 2 x 2 .
The spline function expressed by these two polynomials is identical with the one expressed by a B-spline.
A more general derivation of the B-spline representation of polynomials was developed by Lyche et al. [37] (pp. 15–18), and it was shown that polynomials can be represented in terms of B-splines of at least the same degree.

Appendix B. Transition from Ordinary Polynomial to B-spline

In Appendix A, we showed how second-degree B-spline parameters can be used to derive the parameters for an equivalent representation in the form of ordinary second-degree polynomials. In Appendix B, we explain the reverse procedure: how the ordinary quadratic spline parameters A 0 , A 1 , A 2 , respectively B 0 , B 1 , B 2 , can be used for derivation of the B-spline parameters y 0 , C 1 , C 2 and y 2 .
With Equation (A8), we can express each parameter of the ordinary cubic polynomial as follows:
A 0 ( x 1 x 0 ) = y 0 ( x 1 2 x 1 x 0 ) + C 1 ( x 0 x 1 x 1 x 0 x 0 x 2 x 2 x 0 ) + C 2 ( x 0 2 x 2 x 0 ) ,
A 1 ( x 1 x 0 ) = y 0 ( 2 x 1 x 1 x 0 ) + C 1 ( 2 x 0 x 2 x 0 + 2 x 1 x 1 x 0 ) + C 2 ( 2 x 0 x 2 x 0 ) ,
A 2 ( x 1 x 0 ) = y 0 ( 1 x 1 x 0 ) + C 1 ( 1 x 2 x 0 1 x 1 x 0 ) + C 2 ( 1 x 2 x 0 ) .
According to this approach, the parameters in (A9) can be expressed as:
B 0 ( x 2 x 1 ) = C 1 ( x 2 2 x 2 x 0 ) + C 2 ( x 0 x 2 x 2 x 0 x 1 x 2 x 2 x 1 ) + y 2 ( x 1 2 x 2 x 1 ) ,
B 1 ( x 2 x 1 ) = C 1 ( 2 x 2 x 2 x 0 ) + C 2 ( 2 x 1 x 2 x 1 + 2 x 2 x 2 x 0 ) + y 2 ( 2 x 1 x 2 x 1 ) ,
B 2 ( x 2 x 1 ) = C 1 ( 1 x 2 x 0 ) + C 2 ( 1 x 2 x 1 1 x 2 x 0 ) + y 2 ( 1 x 2 x 1 ) .
From Equations (A10)–(A15), two separate equation systems can be formed to solve for the B-spline parameters. Since the equations are linear, they can be solved by applying some of the methods from linear algebra, such as Gaussian elimination.
Once the systems are solved, the results for the parameters of the system (A10)–(A12) are
y 0 = A 0 + A 1 x 0 + A 2 x 0 2 ,
C 1 = A 0 + A 1 x 0 + x 1 2 + A 2 x 0 x 1 ,
C 2 = A 0 + A 1 x 1 + x 2 2 + A 2 x 1 x 2
and for the system (A13)–(A15), the results are
C 1 = B 0 + B 1 x 0 + x 1 2 + B 2 x 0 x 1 ,
C 2 = B 0 + B 1 x 1 + x 2 2 + B 2 x 1 x 2 ,
y 2 = B 0 + B 1 x 2 + B 2 x 2 2 .
In the terms of B-spline, y 0 and y 2 are parameters and, in this derivation, they are treated as such. If y 0 and y 2 are considered as known values, we can also solve only for C 1 and C 2 as a system of two equations. However, in such case, the solutions for C 1 and C 2 are not as elegant as those from the equations above.

References

  1. Ezhov, N.; Neitzel, F.; Petrovic, S. Spline Approximation—Part 1: Basic Methodology. J. Appl. Geod. 2018, 12, 139–155. [Google Scholar] [CrossRef]
  2. Piegl, L.; Tiller, W. The NURBS Book, 2nd ed.; Springer: Berlin/Heidelberg, Germany, 1997. [Google Scholar]
  3. de Boor, C. On calculating with B-splines. J. Approx. Theory 1972, 6, 50–62. [Google Scholar] [CrossRef] [Green Version]
  4. Cox, M. The numerical evaluation of B-splines. IMA J. Appl. Math. 1972, 10, 134–149. [Google Scholar] [CrossRef]
  5. Lowther, J.; Shene, C.-K. Teaching B-splines is not difficult! ACM SIGCSE Bull. 2003, 35, 381–385. [Google Scholar] [CrossRef]
  6. Berkhahn, V. Geometric Modelling in Civil Engineering Informatics. Habilitation Thesis, University of Hannover, Hanover, Germany, Shaker Verlag, Aachen, Germany, 2005. (In German). [Google Scholar]
  7. Farin, G. Curves and Surfaces for CAGD: A Practical Guide, 5th ed.; Morgan Kaufmann Publishers: San Francisco, CA, USA, 2002. [Google Scholar]
  8. Lobatschewsky, N. Probabilité des résultats moyens tirés d’observations répetées. J. Die Reine Angew. Math. 1842, 24, 164–170. [Google Scholar]
  9. Schoenberg, I.J. Contributions to the problem of approximation of equidistant data by analytic functions, Part A: On the problem of smoothing of graduation, a first class of analytic approximation formulae. Quart. Appl. Math. 1946, 4, 45–99. [Google Scholar] [CrossRef] [Green Version]
  10. Schoenberg, I.J. Contributions to the problem of approximation of equidistant data by analytic functions, Part B: On the problem of osculatory interpolation, a second class of analytic approximation formulae. Quart. Appl. Math. 1946, 4, 112–141. [Google Scholar] [CrossRef] [Green Version]
  11. Schumaker, L. Spline Functions: Basic Theory, 3rd ed.; Cambridge University Press: Cambridge, UK, 2007. [Google Scholar]
  12. de Boor, C.; Pinkus, A. The B-spline recurrence relations of Chakalov and of Popoviciu. J. Approx. Theory 2003, 124, 115–123. [Google Scholar] [CrossRef] [Green Version]
  13. Szilvasi-Nagy, M. Almost curvature continuous fitting of B-spline surfaces. J. Geom. Graph. 1998, 2, 33–43. [Google Scholar]
  14. Zheng, W.; Bo, P.; Liu, Y.; Wang, W. Fast B-spline curve fitting by L-BFGS. Comput. Aided Geom. Des. 2012, 29, 448–462. [Google Scholar] [CrossRef] [Green Version]
  15. Wold, S. Spline functions in data analysis. Technometrics 1974, 16, 1–11. [Google Scholar] [CrossRef]
  16. Anderson, I.; Turner, D. Discrete B-spline approximation in a variety of norms. In Advanced Mathematical and Computational Tools in Metrology V; Ciarlini, P., Cox, M.G., Filipe, E., Pavese, F., Richter, D., Eds.; World Scientific Publishing Company: Singapore, 2001; pp. 1–15. [Google Scholar]
  17. Sünkel, H. Reconstruction of functions from discrete mean values using bicubic spline functions. In Mitteilungen der Geodätischen Institute der Technischen Universität Graz; Contributions of the Graz Group to the XVI General Assembly of IUGG/IAG in Grenoble 1975, Folge 20; Meissl, P., Moritz, H., Rinner, K., Eds.; Graz University of Technology: Graz, Austria, 1975; pp. 267–304. [Google Scholar]
  18. Sünkel, H. The representation of geodetic integral formulae by bicubic spline functions. In Mitteilungen der Geodätischen Institute der Technischen Universität Graz; Folge 28; Graz University of Technology: Graz, Austria, 1977. (In German) [Google Scholar]
  19. Sünkel, H. Local interpolation of gravity data using spline functions. In Tagungsbericht über das 1. Alpengravimetrie-Kolloquium; Steinhauser, P., Ed.; Zentralanstalt für Meteorologie und Geodynamik: Vienna, Austria, 1977; pp. 83–101. (In German) [Google Scholar]
  20. Sünkel, H. A General Surface Representation Module Designed for Geodesy (GSPP); Report No. 292; Department of Geodetic Science, The Ohio State University: Columbus, OH, USA, 1980. [Google Scholar]
  21. Schoenberg, I.J. Cardinal Spline Interpolation; Regional Conference Series in Applied Mathematics, No. 12; SIAM: Philadelphia, PA, USA, 1973. [Google Scholar]
  22. Schumaker, L.L. Fitting surfaces to scattered data. In Approximation Theory II; Lorentz, G.G., Chui, C.K., Schumaker, L.L., Eds.; Academic Press: New York, NY, USA, 1976; pp. 203–268. [Google Scholar]
  23. Späth, H. Spline Algorithms for Construction of Smooth Curves and Surfaces; Oldenbourg: München-Vienna, Austria, 1973. (In German) [Google Scholar]
  24. Jekeli, C. Spline Representations of Functions on a Sphere for Geopotential Modeling; Report No. 475; Department of Civil and Environmental Engineering and Geodetic Science, The Ohio State University: Columbus, OH, USA, 2005. [Google Scholar]
  25. Mautz, R.; Ping, J.; Heki, K.; Schaffrin, B.; Shum, C.; Potts, L. Efficient spatial and temporal representations of global ionosphere maps over Japan using B-spline wavelets. J. Geod. 2005, 78, 660–667. [Google Scholar] [CrossRef]
  26. Koch, K.R.; Schmidt, M. N-dimensional B-spline surface estimated by lofting for locally improving IRI. J. Geod. Sci. 2011, 1, 41–51. [Google Scholar] [CrossRef]
  27. Dzapo, M.; Junasevic, M.; Lapaine, M.; Petrovic, S. Use of splines for determination of lengths from starting point along railway lines. Geod. List. 1985, 39, 99–105. (In Croatian) [Google Scholar]
  28. Bureick, J.; Neuner, H.; Harmening, C.; Neumann, I. Curve and surface approximation of 3D point clouds. Avn Allg. Vermess. Nachr. 2016, 123, 315–327. [Google Scholar]
  29. Kermarrec, G.; Hartmann, J.; Faust, H.; Hartmann, K.; Besharat, R.; Samuel, G.; Lixian, C.; Alkhatib, H. Understanding hierarchical B-splines with a case study: Approximation of point clouds from TLS observations. Z. Geodäsie Geoinf. Landmanagement 2020, 145, 224–235. [Google Scholar]
  30. Harmening, C. Spatio-Temporal Deformation Analysis Using Enhanced B-Spline Models of Laser Scanning Point Clouds. Ph.D. Thesis, Technische Universität Wien, Faculty of Mathematics and Geoinformation, Vienna, Austria, 2020. [Google Scholar]
  31. Gander, W. Change of basis in polynomial interpolation. Numer. Linear Algebra Appl. 2005, 12, 769–778. [Google Scholar] [CrossRef]
  32. Bronshtein, I.N.; Semendyayev, K.A.; Musiol, G.; Muehlig, H. Handbook of Mathematics, 5th ed.; Springer: Berlin/Heidelberg, Germany, 2007. [Google Scholar]
  33. Rockafellar, R.T. Convex Analysis; Princeton Mathematical Series 28; Princeton University Press: Princeton, NJ, USA, 1970. [Google Scholar]
  34. Bureick, J.; Alkhatib, H.; Neumann, I. Robust spatial approximation of laser scanner point clouds by means of free-form curve approaches in deformation analysis. J. Appl. Geod. 2016, 10, 27–35. [Google Scholar] [CrossRef]
  35. Niemeier, W. Adjustment Computation, Statistical Evaluation Methods, 2nd ed.; De Gruyter: Boston, MA, USA, 2008. (In German) [Google Scholar]
  36. Neitzel, F.; Ezhov, N.; Petrovic, S. Total least squares spline approximation. Mathematics 2019, 7, 462. [Google Scholar] [CrossRef] [Green Version]
  37. Lyche, T.; Manni, C.; Speleers, H. B-Splines and Spline Approximation. 2017. Available online: https://www.mat.uniroma2.it/~speleers/cime2017/material/notes_lyche.pdf (accessed on 9 July 2021).
Figure 1. Monomial basis functions for a parabola in the interval [0, 1].
Figure 1. Monomial basis functions for a parabola in the interval [0, 1].
Mathematics 09 02198 g001
Figure 2. Lagrange basis functions for a parabola in the interval [0, 3] for the example x 0 = 0 , x 1 = 1 and x 2 = 3 .
Figure 2. Lagrange basis functions for a parabola in the interval [0, 3] for the example x 0 = 0 , x 1 = 1 and x 2 = 3 .
Mathematics 09 02198 g002
Figure 3. Line interpolation.
Figure 3. Line interpolation.
Mathematics 09 02198 g003
Figure 4. Lagrange interpolation by lines (black) and by a parabola (red).
Figure 4. Lagrange interpolation by lines (black) and by a parabola (red).
Mathematics 09 02198 g004
Figure 5. Extended line segments from Lagrangian form.
Figure 5. Extended line segments from Lagrangian form.
Mathematics 09 02198 g005
Figure 6. Geometrical interpretation of the term ( y 2 + y 0 ) / 2 .
Figure 6. Geometrical interpretation of the term ( y 2 + y 0 ) / 2 .
Mathematics 09 02198 g006
Figure 7. Bernstein basis polynomials for a parabola in the interval [0, 1].
Figure 7. Bernstein basis polynomials for a parabola in the interval [0, 1].
Mathematics 09 02198 g007
Figure 8. Construction of a Bernstein polynomial. The extremum of the parabola is marked with a red dot and the control point with a blue dot. Green dots indicate points on the parabola, resp. points resulting from extension of straight lines between these points to the boundaries of the interval [ x 0 , x 2 ] . The convex hull formed by the control points ( x 0 , y 0 ) , ( C x , C y ) and ( x 2 , y 2 ) is highlighted in grey.
Figure 8. Construction of a Bernstein polynomial. The extremum of the parabola is marked with a red dot and the control point with a blue dot. Green dots indicate points on the parabola, resp. points resulting from extension of straight lines between these points to the boundaries of the interval [ x 0 , x 2 ] . The convex hull formed by the control points ( x 0 , y 0 ) , ( C x , C y ) and ( x 2 , y 2 ) is highlighted in grey.
Mathematics 09 02198 g008
Figure 9. Initial situation before the construction of the second part of the spline. The extremum of the first parabola is marked with a red dot, the control point with a blue dot, and the green dots indicate points to be interpolated.
Figure 9. Initial situation before the construction of the second part of the spline. The extremum of the first parabola is marked with a red dot, the control point with a blue dot, and the green dots indicate points to be interpolated.
Mathematics 09 02198 g009
Figure 10. Line segment ( x 1 , y 1 ) ( x 2 , C y 2 ) ¯ . The extremum of the first parabola is marked with a red dot, the control point with a blue dot, and the green dots indicate points to be interpolated.
Figure 10. Line segment ( x 1 , y 1 ) ( x 2 , C y 2 ) ¯ . The extremum of the first parabola is marked with a red dot, the control point with a blue dot, and the green dots indicate points to be interpolated.
Mathematics 09 02198 g010
Figure 11. Line segment ( x 1 , C y 2 ) ( x 2 , y 2 ) ¯ . The extrema of the parabolas are marked with a red dot, the control points with a blue dot, and the green dots indicate points to be interpolated.
Figure 11. Line segment ( x 1 , C y 2 ) ( x 2 , y 2 ) ¯ . The extrema of the parabolas are marked with a red dot, the control points with a blue dot, and the green dots indicate points to be interpolated.
Mathematics 09 02198 g011
Figure 12. Second parabola within the interval [ x 1 , x 2 ] , smoothly connected to the previous one. The extrema of the parabolas are marked with a red dot, the control points with a blue dot, and the green dots indicate points to be interpolated.
Figure 12. Second parabola within the interval [ x 1 , x 2 ] , smoothly connected to the previous one. The extrema of the parabolas are marked with a red dot, the control points with a blue dot, and the green dots indicate points to be interpolated.
Mathematics 09 02198 g012
Figure 13. Quadratic B-Spline basis functions using the knots x k 0 = 0 , x k 1 = 1 and x k 2 = 3 , resulting in two intervals k = 0 and k = 1 , and the knot sequence [ 0 , 0 , 0 , 1 , 3 , 3 , 3 ] . The knots are marked with black triangles on the x-axis.
Figure 13. Quadratic B-Spline basis functions using the knots x k 0 = 0 , x k 1 = 1 and x k 2 = 3 , resulting in two intervals k = 0 and k = 1 , and the knot sequence [ 0 , 0 , 0 , 1 , 3 , 3 , 3 ] . The knots are marked with black triangles on the x-axis.
Mathematics 09 02198 g013
Table 1. Numerical example for interpolating a parabola.
Table 1. Numerical example for interpolating a parabola.
ixiyi
001
113
232
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Ezhov, N.; Neitzel, F.; Petrovic, S. Spline Approximation, Part 2: From Polynomials in the Monomial Basis to B-splines—A Derivation. Mathematics 2021, 9, 2198. https://doi.org/10.3390/math9182198

AMA Style

Ezhov N, Neitzel F, Petrovic S. Spline Approximation, Part 2: From Polynomials in the Monomial Basis to B-splines—A Derivation. Mathematics. 2021; 9(18):2198. https://doi.org/10.3390/math9182198

Chicago/Turabian Style

Ezhov, Nikolaj, Frank Neitzel, and Svetozar Petrovic. 2021. "Spline Approximation, Part 2: From Polynomials in the Monomial Basis to B-splines—A Derivation" Mathematics 9, no. 18: 2198. https://doi.org/10.3390/math9182198

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop