In

:$S:;\; href="/html/ALL/s/,b.html"\; ;"title=",b">,b$ We want ''S'' to be piecewise defined. To accomplish this, let the interval 'a'',''b''be covered by ''k'' ordered, subintervals, :$;\; href="/html/ALL/s/\_i,\_t\_.html"\; ;"title="\_i,\; t\_">\_i,\; t\_$ :$[a,b]\; =\; [t\_0,t\_1]\; \backslash cup\; [t\_1,t\_2]\; \backslash cup\; \backslash cdots\; \backslash cup\; [t\_,t\_]\; \backslash cup\; [t\_,t\_k]$ :$a\; =\; t\_0\; \backslash le\; t\_1\; \backslash le\; \backslash cdots\; \backslash le\; t\_\; \backslash le\; t\_k\; =\; b$ On each of these ''k'' "pieces" of [''a'',''b''], we want to define a polynomial, call it ''P''_{''i''}.

:$P\_i:\; [t\_i,\; t\_]\backslash to\; \backslash mathbb$. On the ''i''th subinterval of [''a'',''b''], ''S'' is defined by ''P''_{''i''},

:$S(t)\; =\; P\_0\; (t)\; \backslash mbox\; t\_0\; \backslash le\; t\; <\; t\_1,$ :$S(t)\; =\; P\_1\; (t)\; \backslash mbox\; t\_1\; \backslash le\; t\; <\; t\_2,$ :$\backslash vdots$ :$S(t)\; =\; P\_\; (t)\; \backslash mbox\; t\_\; \backslash le\; t\; \backslash le\; t\_k.$ The given ''k+1'' points ''t''_{''i''} are called knots. The vector
$=(t\_0,\; \backslash dots,\; t\_k)$ is called a knot vector for the spline.
If the knots are equidistantly distributed in the interval 'a'',''b''we say the spline is uniform, otherwise we say it is non-uniform.
If the polynomial pieces ''P''_{''i''} each have degree at most ''n'', then the spline is said to be of degree $\backslash leq\; n$ (or of
order ''n+1'').
If $S\backslash in\; C^$ in a neighborhood of ''t''_{''i''}, then the spline is said to be
of Smooth function, smoothness (at least) $C^$ at ''t''_{''i''}. That is,
at ''t''_{''i''} the two pieces ''P''_{''i-1''} and ''P''_{''i''} share common
derivative values from the derivative of order 0 (the function value)
up through the derivative of order ''r''_{''i''} (in other words, the two adjacent polynomial pieces connect with loss of smoothness of at most ''n'' - ''r''_{''i''}).
A vector
$=(r\_1,\; \backslash dots,\; r\_)$ such that the spline has smoothness $C^$ at ''t''_{''i''} for $i\; =\; 0,\backslash ldots,\; k-1$ is called a smoothness vector for the spline.
Given a knot vector $$, a degree ''n'', and a smoothness vector $$ for $$, one can consider the set of all splines of degree $\backslash leq\; n$ having knot vector
$$ and smoothness vector $$. Equipped with the operation of adding two functions (pointwise addition) and taking real multiples of functions, this set becomes a real vector space. This spline space is commonly denoted by $S^\_n()$.
In the mathematical study of polynomial splines the question of what happens when two knots,
say ''t''_{''i''} and ''t''_{''i''+1},
are moved together has an easy answer. The polynomial piece
''P''_{''i''}(''t'')
disappears, and the pieces
''P''_{''i''−1}(''t'') and ''P''_{''i''+1}(''t'')
join with the sum of the continuity losses for
''t''_{''i''} and ''t''_{''i''+1}.
That is,
:$S(t)\; \backslash in\; C^\; [t\_i\; =\; t\_],$ where $j\_i\; =\; n\; -\; r\_i$
This leads to a more general understanding of a knot vector.
The continuity loss at any point can be considered to be the result of
multiple knots located at that point, and a spline type can be completely
characterized by its degree ''n'' and its extended knot vector
:$(t\_0\; ,\; t\_1\; ,\; \backslash cdots\; ,\; t\_1\; ,\; t\_2,\; \backslash cdots\; ,\; t\_2\; ,\; t\_3\; ,\; \backslash cdots\; ,\; t\_\; ,\; t\_\; ,\; \backslash cdots\; ,\; t\_\; ,\; t\_k)$
where ''t''_{''i''} is repeated ''j''_{''i''} times
for $i\; =\; 1,\; \backslash dots\; ,\; k-1$.
A parametric curve on the interval [''a'',''b'']
:$G(t)\; =\; (\; X(t),\; Y(t)\; )\; \backslash mbox\; t\; \backslash in\; [\; a\; ,\; b\; ]$
is a spline curve if both ''X'' and ''Y'' are spline functions
of the same degree with the same extended knot vectors on that interval.

^{2}.
The word "natural" means that the second derivatives of
the spline polynomials
are set equal to zero at the endpoints of the interval of interpolation
:$S\text{'}\text{'}(a)\; \backslash ,\; =\; S\text{'}\text{'}(b)\; =\; 0.$
This forces the spline to be a straight line outside of the interval, while not disrupting its smoothness.

Given set of coordinates $C=\; \backslash left[\; \backslash left\; (\; \_,\_\; \backslash right\; )\; ,\; \backslash left\; (\; \_,\_\; \backslash right\; )\; ,\; ....\; ,\; \backslash left\; (\; \_,\_\; \backslash right\; )\; \backslash right\; ]$ we wish to find set of $n\; \backslash ,$ splines $\_\; \backslash left\; (\; x\; \backslash right\; )$ for $i\; =\; 0\; ,\; \backslash ldots\; ,\; n-1.$ These must satisfy: *$S\_i\; \backslash left\; (x\_i\; \backslash right)\; =\; y\_i\; =\; S\_\backslash left\; (x\_i\; \backslash right\; ),\; i\; =\; 1\; ,\; \backslash ldots\; ,\; n-1.$ *$\_i\; \backslash left\; (x\_i\; \backslash right)\; =\; \_\backslash left\; (x\_i\; \backslash right\; ),\; i\; =\; 1\; ,\; \backslash ldots\; ,\; n-1.$ *$\_i\; \backslash left\; (x\_i\; \backslash right)\; =\; \_\backslash left\; (x\_i\; \backslash right\; ),\; i\; =\; 1\; ,\; \backslash ldots\; ,\; n-1.$ *$\_0\; \backslash left\; (x\_0\; \backslash right)\; =\; \_\; \backslash left\; (x\_n\; \backslash right\; )\; =0$. Let us define one cubic spline $S\; \backslash ,$ as a 5-tuple $(a,b,c,d,x\_t)\; \backslash ,$ where $a,b,c\; \backslash ,$ and $d\; \backslash ,$ correspond to coefficients in the form shown earlier and $x\_t\; \backslash ,$ is equal to $x\_j.\; \backslash ,$ Algorithm for computing Natural Cubic Splines:

Input: set of coordinates $C\; \backslash ,$, with $\backslash left\; ,\; C\; \backslash right\; ,\; =n+1$

Output: set splines which is composed of ''n'' 5-tuples. # Create new array ''a'' of size ''n + 1'' and for $i\; =\; 0\; ,\; \backslash ldots\; ,\; n$ set $a\_i\; =\; y\_i\; \backslash ,$ # Create new arrays ''b'' and ''d'' each of size ''n''. # Create new array ''h'' of size ''n'' and for $i\; =\; 0\; ,\; \backslash ldots\; ,\; n-1$ set $h\_i\; =\; x\_\; -\; x\_i\; \backslash ,$ # Create new array ''α'' of size ''n'' and for $i\; =\; 1\; ,\; \backslash ldots\; ,\; n-1$ set $\_=\; \backslash frac\; \backslash left\; (\; \_-\_\; \backslash right\; )\; -\; \backslash frac\; \backslash left\; (\; \_-\_\; \backslash right\; )$. # Create new arrays ''c'', ''l'', ''μ'', and ''z'' each of size $n+1\; \backslash ,$. # Set $l\_0\; =\; 1,\; \_0\; =\; z\_0\; =\; 0\; \backslash ,$ # For $i\; =\; 1\; ,\; \backslash ldots\; ,\; n-1\; \backslash ,$ ## Set $\_\; =2\; \backslash left\; (\; \_-\_\; \backslash right\; )\; -\; \_\_$. ## Set $\_=\; \backslash frac$. ## Set $\_\; =\; \backslash frac$. # Set $l\_n\; =\; 1;\; z\_n\; =\; c\_n\; =\; 0.\; \backslash ,$ # For $j\; =\; n-1\; ,\; n-2\; ,\; \backslash ldots\; ,\; 0$ ## Set $c\_j\; =\; z\_j\; -\; \_j\; c\_\; \backslash ,$ ## Set $b\_j\; =\; \backslash frac\; -\; \backslash frac$ ## Set $d\_j\; =\; \backslash frac$ # Create new set Splines and call it output_set. Populate it with ''n'' splines ''S''. # For $i\; =\; 0\; ,\; \backslash ldots\; ,\; n-1$ ## Set ''S''_{''i'',''a''} = ''a''_{''i''}
## Set ''S''_{''i'',''b''} = ''b''_{''i''}
## Set ''S''_{''i'',''c''} = ''c''_{''i''}
## Set ''S''_{''i'',''d''} = ''d''_{''i''}
## Set ''S''_{''i'',''x''} = ''x''_{''i''}
# Output output_set

_{''i''} appears more than ''n'' + 1 times in an extended knot vector, all instances of it in excess of the (''n'' + 1)th can be removed without changing the character of the spline, since all multiplicities ''n'' + 1, ''n'' + 2, ''n'' + 3, etc. have the same meaning. It is commonly assumed that any knot vector defining any type of spline has been culled in this fashion.
The classical spline type of degree ''n'' used in numerical analysis has continuity
:$S(t)\; \backslash in\; \backslash mathrm^\; [a,b],\backslash ,$
which means that every two adjacent polynomial pieces meet in their value and first ''n'' - 1 derivatives at each knot. The mathematical spline that most closely models the flat spline is a cubic (''n'' = 3), twice continuously differentiable (''C''^{2}), natural spline, which is a spline of this classical type with additional conditions imposed at endpoints ''a'' and ''b''.
Another type of spline that is much used in graphics, for example in drawing programs such as Adobe Illustrator from Adobe Systems, has pieces that are cubic but has continuity only at most
:$S(t)\; \backslash in\; \backslash mathrm^\; [a,b].$
This spline type is also used in PostScript as well as in the definition of some computer typographic fonts.
Many computer-aided design systems that are designed for high-end graphics and animation use extended knot vectors,
for example Autodesk Maya.
Computer-aided design systems often use an extended concept of a spline known as a Nonuniform rational B-spline (NURBS).
If sampled data from a function or a physical object is available,

^{2} interpolating cubic spline at a point ''x'' with the natural condition can be found using the formula
:$S\_i(x)=\; \backslash frac\; +\backslash frac+\backslash left[\; \backslash frac-\backslash frac\backslash right](x-t\_)+\backslash left[\; \backslash frac-\backslash frac\backslash right](t\_i-x)$
where
* $z\_i\; =\; f^(t\_i)$ are the values of the second derivative at the ''i''th knot.
* $h\_i^\; =\; t\_i-t\_$
* $f(t\_i^)$ are the values of the function at the ''i''th knot.

^{2} splines.
The literature of splines is replete with names for special types of splines.
These names have been associated with:
* The choices made for representing the spline, for example:
** using basis (linear algebra), basis functions for the entire spline (giving us the name B-splines)
** using Bernstein polynomials as employed by Pierre Bézier to represent each polynomial piece (giving us the name Bézier spline (disambiguation), Bézier splines)
* The choices made in forming the extended knot vector, for example:
** using single knots for ''C''^{''n''-1} continuity and spacing these knots evenly on 'a'',''b''(giving us uniform splines)
** using knots with no restriction on spacing (giving us nonuniform splines)
* Any special conditions imposed on the spline, for example:
** enforcing zero second derivatives at ''a'' and ''b'' (giving us natural splines)
** requiring that given data values be on the spline (giving us interpolating splines)
Often a special name was chosen for a type of spline satisfying two or more of the main items above. For example, the Hermite spline is a spline that is expressed using Hermite polynomials to represent each of the individual polynomial pieces. These are most often used with ''n'' = 3; that is, as Cubic Hermite splines. In this degree they may additionally be chosen to be only tangent-continuous (''C''^{1}); which implies that all interior knots are double. Several methods have been invented to fit such splines to given data points; that is, to make them into interpolating splines, and to do so by estimating plausible tangent values where each two polynomial pieces meet (giving us Cardinal splines, Catmull-Rom splines, and Kochanek-Bartels splines, depending on the method used).
For each of the representations, some means of evaluation must be found so that values of the spline can be produced on demand. For those representations that express each individual polynomial piece ''P''_{''i''}(''t'') in terms of
some basis for the degree ''n'' polynomials, this is conceptually straightforward:
* For a given value of the argument ''t'', find the interval in which it lies $t\; \backslash in\; [t\_i,t\_]$
* Look up the polynomial basis chosen for that interval $P\_0,\; \backslash ldots,\; P\_$
* Find the value of each basis polynomial at ''t'': $P\_0(t),\; \backslash ldots,\; P\_(t)$
* Look up the coefficients of the linear combination of those basis polynomials that give the spline on that interval ''c''_{0}, ..., ''c''_{''k''-2}
* Add up that linear combination of basis polynomial values to get the value of the spline at ''t'':
:$\backslash sum\_^\; c\_j\; P\_j(t).$
However, the evaluation and summation steps are often combined in clever ways. For example, Bernstein polynomials are a basis for polynomials that can be evaluated in linear combinations efficiently using special recurrence relations. This is the essence of De Casteljau's algorithm, which features in Bézier curves and Bézier splines{{dn, date=November 2021.
For a representation that defines a spline as a linear combination of basis splines, however, something more sophisticated is needed. The de Boor algorithm is an efficient method for evaluating B-splines.

B-splines and Geometric design

''SIAM News,'' vol. 29, no. 5, 1997. * Epperson

''NA Digest,'' vol. 98, no. 26, 1998. * Stoer & Bulirsch, Introduction to Numerical Analysis. Springer Science+Business Media, Springer-Verlag. p. 93-106. ISBN 0387904204 * Schoenberg, Contributions to the problem of approximation of equidistant data by analytic functions, ''Quart. Appl. Math.,'' vol. 4, pp. 45–99 and 112–141, 1946. * Young, Garrett Birkhoff and applied mathematics, ''Notices of the AMS,'' vol. 44, no. 11, pp. 1446–1449, 1997. * Chapra, Canale, "Numerical Methods for Engineers" 5th edition.

Cubic Splines Module

Prof. John H. Mathews California State University, Fullerton

An Interactive Introduction to Splines

ibiblio.org Excel Function

XLL Excel Addin Function Implementation of cubic spline

Online utilities

Interactive simulation of various cubic splines

Symmetrical Spline Curves

an animation by Theodore Gray, The Wolfram Demonstrations Project, 2007. Computer Code

Notes, PPT, Mathcad, Maple, Mathematica, Matlab

''Holistic Numerical Methods Institute''

various routines

NTCC

Sisl: Opensource C-library for NURBS

SINTEF

VBA Spline Interpolation

vbnumericalmethods.com Splines (mathematics), Interpolation

mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers ( and ), formulas and related structures (), shapes and spaces in which they are contained (), and quantities and their changes ( and ). There is no general consensus abo ...

, a spline is a special function
Function or functionality may refer to:
Computing
* Function key
A function key is a key on a computer
A computer is a machine that can be programmed to carry out sequences of arithmetic or logical operations automatically. Modern comp ...

defined piecewise
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It ...

by polynomial
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). I ...

s.
In interpolating
In the mathematical
Mathematics (from Greek
Greek may refer to:
Greece
Anything of, from, or related to Greece
Greece ( el, Ελλάδα, , ), officially the Hellenic Republic, is a country located in Southeast Europe. Its populatio ...

problems, spline interpolation
In the mathematical
Mathematics (from Greek
Greek may refer to:
Greece
Anything of, from, or related to Greece
Greece ( el, Ελλάδα, , ), officially the Hellenic Republic, is a country located in Southeast Europe. Its population ...

is often preferred to polynomial interpolation
In numerical analysis
(c. 1800–1600 BC) with annotations. The approximation of the square root of 2 is four sexagesimal figures, which is about six decimal figures. 1 + 24/60 + 51/602 + 10/603 = 1.41421296...
Numerical analysis is the study of ...

because it yields similar results, even when using low degree polynomials, while avoiding Runge's phenomenonImage:Runge_phenomenon.svg, upright=1.5, The Runge function (red, highest central peak); the 5th-order interpolating polynomial with equally spaced interpolating points (blue, lowest central peak); and the 9th-order interpolating polynomial with equa ...

for higher degrees.
In the computer science
Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for their application.
Computer science is the study of , , and . Computer science ...

subfields of computer-aided design
Computer-aided design (CAD) is the use of computers (or ) to aid in the creation, modification, analysis, or optimization of a design. This software is used to increase the productivity of the designer, improve the quality of design, improve comm ...

and computer graphics
Computer graphics deals with generating images with the aid of computers
A computer is a machine that can be programmed to Execution (computing), carry out sequences of arithmetic or logical operations automatically. Modern computers can p ...

, the term spline more frequently refers to a piecewise polynomial (parametric) curve
In mathematics, a curve (also called a curved line in older texts) is an object similar to a line (geometry), line, but that does not have to be Linearity, straight.
Intuitively, a curve may be thought of as the trace left by a moving point (geo ...

. Splines are popular curves in these subfields
because of the simplicity of their construction, their ease and accuracy of evaluation, and their capacity to approximate complex shapes through curve fitting
Curve fitting is the process of constructing a curve
In mathematics, a curve (also called a curved line in older texts) is an object similar to a line (geometry), line, but that does not have to be Linearity, straight.
Intuitively, a curve ma ...

and interactive curve design.
The term spline comes from the flexible spline devices used by shipbuilders and to draw smooth shapes.
Introduction

The term "spline" is used to refer to a wide class of functions that are used in applications requiring data interpolation and/or smoothing. The data may be either one-dimensional or multi-dimensional. Spline functions for interpolation are normally determined as the minimizers of suitable measures of roughness (for example integral squared curvature) subject to the interpolation constraints. Smoothing splines may be viewed as generalizations of interpolation splines where the functions are determined to minimize a weighted combination of the average squared approximation error over observed data and the roughness measure. For a number of meaningful definitions of the roughness measure, the spline functions are found to be finite dimensional in nature, which is the primary reason for their utility in computations and representation. For the rest of this section, we focus entirely on one-dimensional, polynomial splines and use the term "spline" in this restricted sense.Definition

We begin by limiting our discussion to theunivariate In mathematics, a univariate object is an expression, equation
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geom ...

polynomial case. In this case, a spline is a piecewise
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It ...

polynomial
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). I ...

function
Function or functionality may refer to:
Computing
* Function key
A function key is a key on a computer
A computer is a machine that can be programmed to carry out sequences of arithmetic or logical operations automatically. Modern comp ...

.
This function, call it ''S'', takes values from an interval 'a'',''b''and maps them to $\backslash mathbb$, the set of real numbers
Real may refer to:
* Reality, the state of things as they exist, rather than as they may appear or may be thought to be
Currencies
* Brazilian real (R$)
* Central American Republic real
* Mexican real
* Portuguese real
* Spanish real
* Spanish col ...

,:$S:;\; href="/html/ALL/s/,b.html"\; ;"title=",b">,b$ We want ''S'' to be piecewise defined. To accomplish this, let the interval 'a'',''b''be covered by ''k'' ordered, subintervals, :$;\; href="/html/ALL/s/\_i,\_t\_.html"\; ;"title="\_i,\; t\_">\_i,\; t\_$ :$[a,b]\; =\; [t\_0,t\_1]\; \backslash cup\; [t\_1,t\_2]\; \backslash cup\; \backslash cdots\; \backslash cup\; [t\_,t\_]\; \backslash cup\; [t\_,t\_k]$ :$a\; =\; t\_0\; \backslash le\; t\_1\; \backslash le\; \backslash cdots\; \backslash le\; t\_\; \backslash le\; t\_k\; =\; b$ On each of these ''k'' "pieces" of [''a'',''b''], we want to define a polynomial, call it ''P''

:$P\_i:\; [t\_i,\; t\_]\backslash to\; \backslash mathbb$. On the ''i''th subinterval of [''a'',''b''], ''S'' is defined by ''P''

:$S(t)\; =\; P\_0\; (t)\; \backslash mbox\; t\_0\; \backslash le\; t\; <\; t\_1,$ :$S(t)\; =\; P\_1\; (t)\; \backslash mbox\; t\_1\; \backslash le\; t\; <\; t\_2,$ :$\backslash vdots$ :$S(t)\; =\; P\_\; (t)\; \backslash mbox\; t\_\; \backslash le\; t\; \backslash le\; t\_k.$ The given ''k+1'' points ''t''

Examples

Suppose the interval 'a'',''b''is [0,3] and the subintervals are [0,1], [1,2], and [2,3]. Suppose the polynomial pieces are to be of degree 2, and the pieces on [0,1] and [1,2] must join in value and first derivative (at ''t''=1) while the pieces on [1,2] and [2,3] join simply in value (at ''t'' = 2). This would define a type of spline ''S''(''t'') for which :$S(t)\; =\; P\_0\; (t)\; =\; -1+4t-t^2\; \backslash mbox\; 0\; \backslash le\; t\; <\; 1$ :$S(t)\; =\; P\_1\; (t)\; =\; 2t\; \backslash mbox\; 1\; \backslash le\; t\; <\; 2$ :$S(t)\; =\; P\_2\; (t)\; =\; 2-t+t^2\; \backslash mbox\; 2\; \backslash le\; t\; \backslash le\; 3$ would be a member of that type, and also :$S(t)\; =\; P\_0\; (t)\; =\; -2-2t^2\; \backslash mbox\; 0\; \backslash le\; t\; <\; 1$ :$S(t)\; =\; P\_1\; (t)\; =\; 1-6t+t^2\; \backslash mbox\; 1\; \backslash le\; t\; <\; 2$ :$S(t)\; =\; P\_2\; (t)\; =\; -1+t-2t^2\; \backslash mbox\; 2\; \backslash le\; t\; \backslash le\; 3$ would be a member of that type. (Note: while the polynomial piece 2''t'' is not quadratic, the result is still called a quadratic spline. This demonstrates that the degree of a spline is the maximum degree of its polynomial parts.) The extended knot vector for this type of spline would be (0, 1, 2, 2, 3). The simplest spline has degree 0. It is also called a step function. The next most simple spline has degree 1. It is also called a linear spline. A closed linear spline (i.e, the first knot and the last are the same) in the plane is just a polygon. A common spline is the natural cubic spline of degree 3 with continuity ''C''Algorithm for computing natural cubic splines

Cubic splines are of the form $\_\; \backslash left\; (\; x\; \backslash right\; )\; =\; a\_j\; +\; b\_j\; \backslash left\; (\; x-x\_j\; \backslash right\; )\; +\; c\_j\; ^\; +\; d\_j\; ^$.Given set of coordinates $C=\; \backslash left[\; \backslash left\; (\; \_,\_\; \backslash right\; )\; ,\; \backslash left\; (\; \_,\_\; \backslash right\; )\; ,\; ....\; ,\; \backslash left\; (\; \_,\_\; \backslash right\; )\; \backslash right\; ]$ we wish to find set of $n\; \backslash ,$ splines $\_\; \backslash left\; (\; x\; \backslash right\; )$ for $i\; =\; 0\; ,\; \backslash ldots\; ,\; n-1.$ These must satisfy: *$S\_i\; \backslash left\; (x\_i\; \backslash right)\; =\; y\_i\; =\; S\_\backslash left\; (x\_i\; \backslash right\; ),\; i\; =\; 1\; ,\; \backslash ldots\; ,\; n-1.$ *$\_i\; \backslash left\; (x\_i\; \backslash right)\; =\; \_\backslash left\; (x\_i\; \backslash right\; ),\; i\; =\; 1\; ,\; \backslash ldots\; ,\; n-1.$ *$\_i\; \backslash left\; (x\_i\; \backslash right)\; =\; \_\backslash left\; (x\_i\; \backslash right\; ),\; i\; =\; 1\; ,\; \backslash ldots\; ,\; n-1.$ *$\_0\; \backslash left\; (x\_0\; \backslash right)\; =\; \_\; \backslash left\; (x\_n\; \backslash right\; )\; =0$. Let us define one cubic spline $S\; \backslash ,$ as a 5-tuple $(a,b,c,d,x\_t)\; \backslash ,$ where $a,b,c\; \backslash ,$ and $d\; \backslash ,$ correspond to coefficients in the form shown earlier and $x\_t\; \backslash ,$ is equal to $x\_j.\; \backslash ,$ Algorithm for computing Natural Cubic Splines:

Input: set of coordinates $C\; \backslash ,$, with $\backslash left\; ,\; C\; \backslash right\; ,\; =n+1$

Output: set splines which is composed of ''n'' 5-tuples. # Create new array ''a'' of size ''n + 1'' and for $i\; =\; 0\; ,\; \backslash ldots\; ,\; n$ set $a\_i\; =\; y\_i\; \backslash ,$ # Create new arrays ''b'' and ''d'' each of size ''n''. # Create new array ''h'' of size ''n'' and for $i\; =\; 0\; ,\; \backslash ldots\; ,\; n-1$ set $h\_i\; =\; x\_\; -\; x\_i\; \backslash ,$ # Create new array ''α'' of size ''n'' and for $i\; =\; 1\; ,\; \backslash ldots\; ,\; n-1$ set $\_=\; \backslash frac\; \backslash left\; (\; \_-\_\; \backslash right\; )\; -\; \backslash frac\; \backslash left\; (\; \_-\_\; \backslash right\; )$. # Create new arrays ''c'', ''l'', ''μ'', and ''z'' each of size $n+1\; \backslash ,$. # Set $l\_0\; =\; 1,\; \_0\; =\; z\_0\; =\; 0\; \backslash ,$ # For $i\; =\; 1\; ,\; \backslash ldots\; ,\; n-1\; \backslash ,$ ## Set $\_\; =2\; \backslash left\; (\; \_-\_\; \backslash right\; )\; -\; \_\_$. ## Set $\_=\; \backslash frac$. ## Set $\_\; =\; \backslash frac$. # Set $l\_n\; =\; 1;\; z\_n\; =\; c\_n\; =\; 0.\; \backslash ,$ # For $j\; =\; n-1\; ,\; n-2\; ,\; \backslash ldots\; ,\; 0$ ## Set $c\_j\; =\; z\_j\; -\; \_j\; c\_\; \backslash ,$ ## Set $b\_j\; =\; \backslash frac\; -\; \backslash frac$ ## Set $d\_j\; =\; \backslash frac$ # Create new set Splines and call it output_set. Populate it with ''n'' splines ''S''. # For $i\; =\; 0\; ,\; \backslash ldots\; ,\; n-1$ ## Set ''S''

Notes

It might be asked what meaning more than ''n'' multiple knots in a knot vector have, since this would lead to continuities like :$S(t)\; \backslash in\; C^\; \backslash mbox\; m\; >\; 0$ at the location of this high multiplicity. By convention, any such situation indicates a simple discontinuity between the two adjacent polynomial pieces. This means that if a knot ''t''spline interpolation
In the mathematical
Mathematics (from Greek
Greek may refer to:
Greece
Anything of, from, or related to Greece
Greece ( el, Ελλάδα, , ), officially the Hellenic Republic, is a country located in Southeast Europe. Its population ...

is an approach to creating a spline that approximates that data.
General Expression For a ''C''^{2} Interpolating Cubic Spline

Representations and Names

For a given interval 'a'',''b''and a given extended knot vector on that interval, the splines of degree ''n'' form a vector space. Briefly this means that adding any two splines of a given type produces spline of that given type, and multiplying a spline of a given type by any constant produces a spline of that given type. The Hamel dimension, dimension of the space containing all splines of a certain type can be counted from the extended knot vector: :$a\; =\; t\_0\; <\; \backslash underbrace\_\; <\; \backslash cdots\; <\; \backslash underbrace\_\; <\; t\_\; =\; b$ :$j\_i\; \backslash le\; n+1\; ~,~~\; i=1,\backslash ldots,k-2.$ The dimension is equal to the sum of the degree plus the multiplicities :$d\; =\; n\; +\; \backslash sum\_^\; j\_i.$ If a type of spline has additional linear conditions imposed upon it, then the resulting spline will lie in a subspace. The space of all natural cubic splines, for instance, is a subspace of the space of all cubic ''C''History

Before computers were used, numerical calculations were done by hand. Although piecewise-defined functions like the sign function or step function were used, polynomials were generally preferred because they were easier to work with. Through the advent of computers splines have gained importance. They were first used as a replacement for polynomials in interpolation, then as a tool to construct smooth and flexible shapes in computer graphics. It is commonly accepted that the first mathematical reference to splines is the 1946 paper by Isaac Jacob Schoenberg, Schoenberg, which is probably the first place that the word "spline" is used in connection with smooth, piecewise polynomial approximation. However, the ideas have their roots in the aircraft and shipbuilding industries. In the foreword to (Bartels et al., 1987), Robin Forrest describes "lofting", a technique used in the British aircraft industry during World War II to construct templates for airplanes by passing thin wooden strips (called "flat spline, splines") through points laid out on the floor of a large design loft, a technique borrowed from ship-hull design. For years the practice of ship design had employed models to design in the small. The successful design was then plotted on graph paper and the key points of the plot were re-plotted on larger graph paper to full size. The thin wooden strips provided an interpolation of the key points into smooth curves. The strips would be held in place at discrete points (called "ducks" by Forrest; Schoenberg used "dogs" or "rats") and between these points would assume shapes of minimum strain energy. According to Forrest, one possible impetus for a mathematical model for this process was the potential loss of the critical design components for an entire aircraft should the loft be hit by an enemy bomb. This gave rise to "conic lofting", which used conic sections to model the position of the curve between the ducks. Conic lofting was replaced by what we would call splines in the early 1960s based on work by J. C. Ferguson at Boeing and (somewhat later) by Malcolm Sabin, M.A. Sabin at British Aircraft Corporation. The word "spline" was originally an East Anglian English, East Anglian dialect word. The use of splines for modeling automobile bodies seems to have several independent beginnings. Credit is claimed on behalf of Paul de Casteljau, de Casteljau at Citroën, Pierre Bézier at Renault, and Garrett Birkhoff, Birkhoff, Garabedian, and Carl R. de Boor, de Boor at General Motors Corporation, General Motors (see Birkhoff and de Boor, 1965), all for work occurring in the very early 1960s or late 1950s. At least one of de Casteljau's papers was published, but not widely, in 1959. De Boor's work at General Motors Corporation, General Motors resulted in a number of papers being published in the early 1960s, including some of the fundamental work on B-splines. Work was also being done at Pratt & Whitney Aircraft, where two of the authors of (Ahlberg et al., 1967) — the first book-length treatment of splines — were employed, and the David Taylor Model Basin, by Feodor Theilheimer. The work at General Motors Corporation, General Motors is detailed nicely in (Birkhoff, 1990) and (Young, 1997). Davis (1997) summarizes some of this material.References

* Ferguson, James C, ''Multi-variable curve interpolation,'' J. ACM, vol. 11, no. 2, pp. 221-228, Apr. 1964. * Ahlberg, Nielson, and Walsh, ''The Theory of Splines and Their Applications,'' 1967. * Birkhoff, Fluid dynamics, reactor computations, and surface representation, in: Steve Nash (ed.), ''A History of Scientific Computation'', 1990. * Bartels, Beatty, and Barsky, ''An Introduction to Splines for Use in Computer Graphics and Geometric Modeling,'' 1987. * Birkhoff and de Boor, Piecewise polynomial interpolation and approximation, in: H. L. Garabedian (ed.), ''Proc. General Motors Symposium of 1964,'' pp. 164–190. Elsevier, New York and Amsterdam, 1965. * DavisB-splines and Geometric design

''SIAM News,'' vol. 29, no. 5, 1997. * Epperson

''NA Digest,'' vol. 98, no. 26, 1998. * Stoer & Bulirsch, Introduction to Numerical Analysis. Springer Science+Business Media, Springer-Verlag. p. 93-106. ISBN 0387904204 * Schoenberg, Contributions to the problem of approximation of equidistant data by analytic functions, ''Quart. Appl. Math.,'' vol. 4, pp. 45–99 and 112–141, 1946. * Young, Garrett Birkhoff and applied mathematics, ''Notices of the AMS,'' vol. 44, no. 11, pp. 1446–1449, 1997. * Chapra, Canale, "Numerical Methods for Engineers" 5th edition.

External links

TheoryCubic Splines Module

Prof. John H. Mathews California State University, Fullerton

An Interactive Introduction to Splines

ibiblio.org Excel Function

XLL Excel Addin Function Implementation of cubic spline

Online utilities

Interactive simulation of various cubic splines

Symmetrical Spline Curves

an animation by Theodore Gray, The Wolfram Demonstrations Project, 2007. Computer Code

Notes, PPT, Mathcad, Maple, Mathematica, Matlab

''Holistic Numerical Methods Institute''

various routines

NTCC

Sisl: Opensource C-library for NURBS

SINTEF

VBA Spline Interpolation

vbnumericalmethods.com Splines (mathematics), Interpolation