![B-spline curve](https://upload.wikimedia.org/wikipedia/commons/1/18/B-spline_curve.svg)
In the
mathematical
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern mathematics ...
subfield of
numerical analysis
Numerical analysis is the study of algorithms that use numerical approximation (as opposed to symbolic manipulations) for the problems of mathematical analysis (as distinguished from discrete mathematics). It is the study of numerical methods ...
, a B-spline or basis spline is a
spline function that has minimal
support with respect to a given
degree,
smoothness, and
domain partition. Any spline function of given degree can be expressed as a
linear combination of B-splines of that degree. Cardinal B-splines have knots that are equidistant from each other. B-splines can be used for
curve-fitting and
numerical differentiation
In numerical analysis, numerical differentiation algorithms estimate the derivative of a mathematical function or function subroutine using values of the function and perhaps other knowledge about the function.
Finite differences
The simp ...
of experimental data.
In
computer-aided design and
computer graphics
Computer graphics deals with generating images with the aid of computers. Today, computer graphics is a core technology in digital photography, film, video games, cell phone and computer displays, and many specialized applications. A great de ...
, spline functions are constructed as linear combinations of B-splines with a set of control points.
Introduction
The
term
Term may refer to:
* Terminology, or term, a noun or compound word used in a specific context, in particular:
**Technical term, part of the specialized vocabulary of a particular field, specifically:
***Scientific terminology, terms used by scient ...
"B-spline" was coined by
Isaac Jacob Schoenberg
Isaac Jacob Schoenberg (April 21, 1903 – February 21, 1990) was a Romanian-American mathematician, known for his invention of splines.
Life and career
Schoenberg was born in Galați. He studied at the University of Iași, receiving his ...
and is short for basis spline.
A spline function of order
is a
piecewise
In mathematics, a piecewise-defined function (also called a piecewise function, a hybrid function, or definition by cases) is a function defined by multiple sub-functions, where each sub-function applies to a different interval in the domain. P ...
polynomial
In mathematics, a polynomial is an expression consisting of indeterminates (also called variables) and coefficients, that involves only the operations of addition, subtraction, multiplication, and positive-integer powers of variables. An example ...
function of degree
in a variable
. The places where the pieces meet are known as knots. The key property of spline functions is that they and their derivatives may be continuous, depending on the multiplicities of the knots.
B-splines of order
are
basis functions for spline functions of the same order defined over the same knots, meaning that all possible spline functions can be built from a
linear combination of B-splines, and there is only one unique combination for each spline function.
Definition
![Cardinal quartic B-spline](https://upload.wikimedia.org/wikipedia/commons/3/35/Cardinal_quartic_B-spline.svg)
A spline of order
is a
piecewise
In mathematics, a piecewise-defined function (also called a piecewise function, a hybrid function, or definition by cases) is a function defined by multiple sub-functions, where each sub-function applies to a different interval in the domain. P ...
polynomial
In mathematics, a polynomial is an expression consisting of indeterminates (also called variables) and coefficients, that involves only the operations of addition, subtraction, multiplication, and positive-integer powers of variables. An example ...
function of degree
in a variable
. The values of
where the pieces of polynomial meet are known as knots, denoted
and sorted into nondecreasing order. When the knots are distinct, the first
derivatives of the polynomial pieces are continuous across each knot. When
knots are coincident, then only the first
derivatives of the spline are continuous across that knot.
For a given sequence of knots, there is, up to a scaling factor, a unique spline
satisfying
:
If we add the additional constraint that
for all
between the first and last knot, then the scaling factor of
becomes fixed. The resulting
spline functions are called B-splines.
Alternatively, B-splines can be defined by construction by means of the Cox–de Boor recursion formula. Given a knot sequence
, the B-splines of order 1 are defined by
:
These satisfy
for all
because for any
exactly one of the
, and all the others are zero.
The higher-order B-splines are defined by recursion
:
where
:
Properties
A B-spline function is a combination of flexible bands that is controlled by a number of points that are called control points, creating smooth curves. These functions are used to create and manage complex shapes and surfaces using a number of points. B-spline function and Bézier functions are applied extensively in shape optimization methods.
A B-spline of order
is a piecewise polynomial function of degree
in a variable
. It is defined over
locations
, called knots or breakpoints, which must be in non-descending order
. The B-spline contributes only in the range between the first and last of these knots and is zero elsewhere. If each knot is separated by the same distance
(where
) from its predecessor, the knot vector and the corresponding B-splines are called "uniform" (see cardinal B-spline below).
For each finite knot interval where it is non-zero, a B-spline is a polynomial of degree
. A B-spline is a
continuous function at the knots.
[Strictly speaking, B-splines are usually defined as being left-continuous.] When all knots belonging to the B-spline are distinct, its derivatives are also continuous up to the derivative of degree
. If the knots are coincident at a given value of
, the continuity of derivative order is reduced by 1 for each additional coincident knot. B-splines may share a subset of their knots, but two B-splines defined over exactly the same knots are identical. In other words, a B-spline is uniquely defined by its knots.
One distinguishes internal knots and end points. Internal knots cover the
-domain one is interested in. Since a single B-spline already extends over
knots, it follows that the internal knots need to be extended with
endpoints on each side, to give full support to the first and last B-spline, which affect the internal knot intervals. The values of the endpoints do not matter, usually the first or last internal knot is just repeated.
The usefulness of B-splines lies in the fact that any spline function of order
on a given set of knots can be expressed as a linear combination of B-splines:
:
B-splines play the role of
basis functions for the spline function space, hence the name. This property follows from the fact that all pieces have the same continuity properties, within their individual range of support, at the knots.
Expressions for the polynomial pieces can be derived by means of the Cox–de Boor recursion formula
:
:
That is,
is piecewise constant one or zero indicating which knot span ''x'' is in (zero if knot span ''j'' is repeated). The recursion equation is in two parts:
:
ramps from zero to one as ''x'' goes from
to
, and
:
ramps from one to zero as ''x'' goes from
to
. The corresponding ''B''s are zero outside those respective ranges. For example,
is a
triangular function
A triangular function (also known as a triangle function, hat function, or tent function) is a function whose graph takes the shape of a triangle. Often this is an isosceles triangle of height 1 and base 2 in which case it is referred to as ''th ...
that is zero below
, ramps to one at
and back to zero at and beyond
. However, because B-spline basis functions have local
support, B-splines are typically computed by algorithms that do not need to evaluate basis functions where they are zero, such as
de Boor's algorithm In the mathematical subfield of numerical analysis de Boor's algorithmC. de Boor 971 "Subroutine package for calculating with B-splines", Techn.Rep. LA-4728-MS, Los Alamos Sci.Lab, Los Alamos NM; p. 109, 121. is a polynomial-time and numerically sta ...
.
This relation leads directly to the
FORTRAN-coded algorithm BSPLV, which generates values of the B-splines of order ''n'' at ''x''. The following scheme illustrates how each piece of order ''n'' is a linear combination of the pieces of B-splines of order ''n'' − 1 to its left.
:
Application of the recursion formula with the knots at
gives the pieces of the uniform B-spline of order 3
:
These pieces are shown in the diagram. The continuity property of a quadratic spline function and its first derivative at the internal knots are illustrated, as follows
:
The second derivative of a B-spline of degree 2 is discontinuous at the knots:
:
Faster variants of the de Boor algorithm have been proposed, but they suffer from comparatively lower stability.
Cardinal B-spline
A cardinal B-spline has a constant separation ''h'' between knots. The cardinal B-splines for a given order ''n'' are just shifted copies of each other. They can be obtained from the simpler definition.
:
The "placeholder" notation is used to indicate that the ''n''-th
divided difference
In mathematics, divided differences is an algorithm, historically used for computing tables of logarithms and trigonometric functions. Charles Babbage's difference engine, an early mechanical calculator, was designed to use this algorithm in it ...
of the function
of the two variables ''t'' and ''x'' is to be taken by fixing ''x'' and considering
as a function of ''t'' alone.
A cardinal B-spline has uniformly spaced knots, therefore interpolation between the knots equals convolution with a smoothing kernel.
Example, if we want to interpolate three values in between B-spline nodes (
), we can write the signal as
:
Convolution of the signal
with a rectangle function