Talk:Spline (mathematics)

message: I did a complete rewrite of the article. A Bezier curve is not a spline. MathMartin 18:02, 19 Sep 2004 (UTC)
thread_title: [[Bezier curve]] not a spline ?

message: The greater part of the section History is copied verbatim from a post to the NA Digest. Can anybody confirm that we have permission to do this? I also asked the anonymous contributor for clarification at User talk:205.250.40.97. -- Jitse Niesen (talk) 16:16, 6 October 2005 (UTC)
replies: text: Resolved after some e-mails. -- Jitse Niesen (talk) 12:51, 18 October 2005 (UTC)
thread_title:  History section 

message: TERdON
:I have an Excel spreadsheet that calculates a cubic spline, and it produces a graph showing a comparison of the cubic spline and a straight-line. I could always scan this image, but if anyone knows a better way to do something with this spreadsheet to produce a good clear image, I am glad to send you my file or to try it myself. Note: I have very little computer skills - if you want me to do something, you'll have to tell me step by step! 
Sarum blue 14:58, 2 February 2006 (UTC)
thread_title:  This page needs images! 

message: Since this question was raised by an editor [09:41, 28 September 2006 SpaceDude (knots are not points, they are scalar values? would like confirmation on this... how can inequality be used on points?)], let me try to provide a short answer.
In the article's definition of splines, knots are elements of \mathbb{R}.
Whether you call them "points", "vectors", "values", or  ... depends on what you mean by \mathbb{R} in the first place.
If you equip the set \mathbb{R} with the usual structure of an affine space, you can call the knots "points", to emphasize the geometric view of \mathbb{R} as a manifold.
You can then consider "weighted averages" of knots. Such averages are needed by the "de Boor algorithm".
If you equip the set \mathbb{R} with the usual real vector space structure, you can call
the knots "vectors", to emphasize the differential-geometric view of \mathbb{R} as a tangent space/line. You can then consider "sums" and "real multiples" of knots. Very useful for uniform partitions and Fourier techniques to construct B-splines ("box splines").
If you equip the set \mathbb{R} with the usual structure of a field, you can call the knots "values", to emphasize the algebraic view of \mathbb{R} as a space of numbers. You can then consider "sums", "differences", "products" and "quotients" of knots. Very useful for the divided difference approach to B-splines.
If you equip the set \mathbb{R} with the usual ordering structure, you could call the knots "vertices" or "exposed points", to empasize the convexity of the subintervals. You can then consider "in-betweenness" of knots and whether any knot is larger than another one. Needed by polyhedron projection techniques to construct B-splines geometrically ("polyhedral splines", "box splines", "simplex splines", "cone splines").
And so on ...
Now, the set \mathbb{R} is frequently assumed to be equiped with SEVERAL such structures at the same time -- this is not contradictory as long as the structures are compatibile with each other (which they are), so they can be combined meaningfully. This is how "inequalities" can be used on "points": take \mathbb{R} with the usual affine structure and the usual ordering structure combined.
But the assumed (combined) structure(s) are not always stated explicitly though. Fortunately, it is not difficult to work backwards and recover the needed structure(s) on \mathbb{R} from the way the elements of \mathbb{R} are used.
So what are they then, these knots. Are they points? vectors? values? vertices? ...
It depends on the writer. 
My impression is that computer scientists prefer to maximally equip \mathbb{R} with all structures possible, so they can do what they want with its elements (without having to bother about what they mean by \mathbb{R}) and can call them how they want:  "vectors", "values", "points", ...
(Similarly, in "3D" they can speak of "points" and "vectors" -- although CAGD writers definitely prefer "vectors").
Mathematicians, out of economy and clarity, would equip \mathbb{R} only minimally: they wouldn't give it a particular structure unless it is really needed. 
For example, in CAGD text books one speaks of "vectors" even if the origin has no special role, so (affine) "points" would do for mathematicians.
To conclude, knots in \mathbb{R} can be called "vectors", "values", "points", "vertices", ... 
Nevertheless, the term "value" has the disadvantage that it is (so far) not used in multivariate spline theory (not discussed here).
To my way of thinking, knots are parameters connected with the representation of splines as a weighted sum of B-splines. Since B-splines are not mentioned in this article, knots should also not be mentioned. The points where two polynomial pieces join used to be called (e.g., by Birkhoff) "joints" but, these days, the term
'breakpoint' or 'break' is used for such a locus. Use of 'points' for them should be discouraged since one usually deals with data points and only their first coordinate, the data site, gives rise to a break in cubic spline interpolation, while its second coordinate, the data value, is the value one hopes to match at that site by the interpolating spline. Deboor (talk) 03:37, 26 June 2011 (UTC)
thread_title:  Definition: Knots are they points, values, vertices, vectors, or ... ? 

message: Hi the example is ok but need to explicitly show the smoothness vector \mathbf r. SNx 20:11, 4 December 2006 (UTC)
thread_title:  examples 

message: :Expressing the connectivity as a "loss of smoothness" is reasonable, since if S were a simple polynomial throughout a neighborhood of ti, it would have smoothness Cn at ti, and you would expect to lose smoothness in order to break a polynomial apart into pieces.
Every polynomial is in C^{\infty} so it would have smoothness C^{\infty} at ti.
  
However, it's a fact that for 2 polynomials of degree n it's enough their 0 to n derivatives are equal at point p, for these polynomials to be the same one poly. in fact (hence, to be C^{\infty} smooth at point p). Eventually, I understand the idea behind n-"number of knots" loss of smoothness, but it was a bit misleading at first. Any ideas how to improve that? SalvNaut 21:03, 27 September 2007 (UTC)
thread_title:  Polynomials are in ''C''<sup><math>\infty</math></sup> 

message: I'm not competent to edit the content but in Definition section Cr is introduced and while there is some clarification about what it means, there is nothing about what it IS (the set of all functions with derivatives of order 0 to r).  Shouldn't definition section define terms the common reader might be unfamiliar with?  Also, the comment that polynomials are in  C\infty makes the statement that the smoothness is at most n-r, with r = \infty really confusing to us poor laymen --what does a negative smoothness mean?  Might be best to simply remove C and just talk about derivatives to order r.  Introducing C doesn't seem to be necessary. Just a thought.71.31.154.4 (talk) 16:57, 1 November 2009 (UTC)
thread_title:  Clarification  

message: I added the clarification tag on the Definition section.  A huge number of symbols and variables are introduced in the first few sentences.  Even if these are technically rigorously defined (which I don't think they are), some English explanation of what the mathematical statements mean are necessary to improve readability, especially for someone who is being introduced to splines for the first time.  Even the use of the blackboard bold R being used to denote "the set of all real numbers" is just a convention that might be clarified by including a simple entry like "where R is the set of all real numbers" in a list of variable definitions.
mcs (talk) 16:18, 21 August 2008 (UTC)
thread_title:  Definition Section Clarification 

message: I can't find any mention of the univariate spline under tension anywhere on Wikipedia, there is a concise presentation at the beginning of "A method for construction of surfaces under tension" by Nielson and Franke (sorry, no link). This is a very nice generalization of the "natural cubic spline" and piecewise linear interpolation, and the paper mentioned is referenced by "Terrain Simulation Using a Model of Stream Erosion" by Kelley, Malin, and Nielson. Am I not looking in the right place?
136.152.138.22 (talk) 20:12, 17 September 2008 (UTC)
thread_title:  Spline under Tension 

message: Can we discuss validity and maybe clarifying the algorithm I posted?  I am pretty sure it is correct, but I am not a mathematician, and would like some expert opinion on it. 
Also can somebody write an algorithm for computing cubic splines in 3d space?  —Preceding unsigned comment added by Lev a neiman (talk • contribs) 05:25, 10 January 2009 (UTC)
replies: text: hi Lev a neiman. I reviewed the algorithm, since I needed to implement it today, and I've found some small errors. I made the corrections to the algorithm a few minutes ago. In the following paragraphs I will give you an explanation regarding the changes I made and hope that they are valid. but first I have to ask you a question: from where did you get the algorithm? I'm just curious and I would be grateful to hear from you. so, let's move to the abovementioned explanation:
* at point 1., the algorithm mentioned to "create a new array a of size n and for i = 0,...,n-1 set a_i = y_i". since the number of coordinates is n+1, the size of the array a should be n+1 too, due to the fact that the algorithms intends to set a_i = y_i. the for-definition changes too, because we now need to iterate from i = 0,...,n.
* at point 2. I moved the initialization of the array c down to point 5. and initialized it with a size of n + 1, since at point 8. it was mentioned to set c_n = 0. if the array is initialized with a size of n and we wanted to access c[n], we would get an index-out-of-bound-error. the size of n + 1 is also needed, because at point 9. the algorithm accesses c_{j+1} and index j (initialized with n - 1) would cause an index-out-of-bound-error, since in that case it would want to access c[n] in the first iteration.
* at point 4. I changed the size for the array α (alpha) to n. this is due to the fact that the for-definition defines the boundary from 0,...,n-1 and in the following lines no forward-access is made that would cause an index-out-of-bound-error (e.g. α[i+1]).
* finally, at point 9. and 10. I changed the number of splines S to n and the boundary of the for-definition to 0,...,n-1. The first change was made due to the fact that with n + 1 coordinates you will get n splines and the second change is simply a result of the first one.
I hope my feedback and my changes to the algorithm are okay. if you have some suggestions or corrections, I would be pleased to hear from you.
Giuseppe A (talk) 16:47, 6 May 2009 (UTC)
thread_title:  Algorithm 

message: Control point (mathematics) redirects to this article but the article does not use the term "control point";  please define or use the term.  --Una Smith (talk) 04:03, 30 September 2008 (UTC)
thread_title:  Control point 

message: Annoying that the algorithm uses both letter a, and the symbol alpha, and the fonts (at least where I am) display both in a very similar fashion in parts of the formulas.  —Preceding unsigned comment added by 66.205.73.36 (talk) 02:59, 21 January 2009 (UTC)
thread_title:  Hard to read 

message: No information on how one would go about reticulating them? Why not? We need to add this in right away.  —Preceding unsigned comment added by Pomegranete (talk • contribs) 10:59, 5 September 2009 (UTC)
thread_title:  Reticulating Splines 

message: The section Spline (mathematics)#Theoretical problem in random space should be deleted.  It was added by user:Yuanfangdelang who has added a lot of similarly dubious material to several statistics articles.  Skbkekas (talk) 02:50, 26 January 2010 (UTC)
replies: text: This section has now been deleted. Skbkekas (talk) 20:30, 29 January 2010 (UTC)
thread_title:  Propose section for deletion 

message: The equation for S_i(x) in this section is for the cubic polynomial solving the boundary value problem: 
* S_i(t_i^{}) = f^{}(t_i^{}) , 
* S^{\prime\prime}_i(t_i) = f^{\prime\prime}(t_i) , 
* S_i(t_{i-1}^{}) = f^{}(t_{i-1}^{}) ,
* S^{\prime\prime}_i(t_{i-1}) = f^{\prime\prime}(t_{i-1}) 
Notice that there is nothing about the first derivative S^{\prime}_i(x), and in fact when used on non-trivial data the first derivatives do not match at the knots.  Thus the resulting cubic is actually only C0, no better -- at least in terms of continuity -- than a linear interpolation. 
This section also seems to differ from the previous sections on the same page in that S_i(x) is for [t_{i-1}, \  t_i] where earlier S_i(x) is for [t_{i}, \   t_{i+1}].
It appears that more than a year ago this had the closed form solution for the standard C1 continuous cubic spline.  It would seem appropriate to revert to that or similar.  —Preceding unsigned comment added by PondTapir (talk • contribs) 04:12, 7 August 2010 (UTC)
thread_title:  "General expression for a ''C''<sup>2</sup> interpolating cubic spline" seems incorrect 

message: The algorithm appears to compute the natural cubic spline, which is the title of the preceding section (and this one does not describe an algorithm).  A clamped cubic spline is not otherwise defined in the article.  Also, the values computed for the z array are never described.  This is especially confusing because the array z is used in the description following as the second derivative at the knots and the values of z computed are not.  Other computed terms could use descriptions as well, such as alpha (triple the difference of the mean slope on adjacent intervals).  Further, the mean slope in each interval could be used to simplify the description of the computation of alpha.  The array mu is allocated to hold n+1 items, but only n are assigned (or used).
JCRVMD (talk) 23:01, 7 January 2011 (UTC)
thread_title:  Confused Algorithm for computing clamped cubic splines 

message: Why does the article start with this image? ?  Of all spline images in "WIKI Commons" this seems to be the strangest and the least suitable for the article!
It says:
"In mathematics, a spline is a special function defined piecewise by polynomials."
and
"In  computer science subfields of computer-aided design and computer graphics, the term "spline" more frequently refers to a piecewise polynomial (parametric) curve."
There is therefore no difference in the use of this term between "mathematics" and "computer science"!!
The "Introduction" and even more the "Definition" are strange making rather simple matter sound complicated with a lot of mathematical terminology that really does not help!
A re-write:
++++++++++++++++++++++++++++++++++++++++++++
In mathematics, a spline of degree n is a function defined in a number of adjacent intervals by polynomials of degree n, i.e.
:S(t) = P_0 (t) \mbox{ , } t_0 \le t < t_1,
:S(t) = P_1 (t) \mbox{ , } t_1 \le t < t_2,
:::\vdots
:S(t) = P_{k-1} (t) \mbox{ , } t_{k-1} \le t \le t_k.
where the polynomials P_0 (t), P_1 (t) \cdot P_{k-1}
are such that S(t) is a continuous and (n-1) times differentiable function in the full interval t_0 < t < t_k,. A simple example of a spline of degree 2 is
 
:S(t) = (t+1)^2-1 \mbox{ , } -2 \le t < 0
:S(t) = 1-(t-1)^2\mbox{ , } 0 \le t \le 2
for which S'(0)=2.
The by far most important spline functions are the "cubic splines" of degree 3 as these are the splines used for spline interpolation for which the 4 parameters of a third order polynomial in general are needed to get a good and smooth interpolation. The term "spline" in fact originate from the elastic splines used by craftsmen to draw smooth bent curves passing through a number of given point, called the "knots", and these curves can to a first approximation can be considered to be cubic splines where the "knots" are the points where the different third degree polynomials meet.  For this, see Spline interpolation. 
+++++++++++++++++++++++++++++++++++++++++++
And this should all be illustrated with figures!! The strange figure included could for example be replaced by a graph of the function 
:S(t) = (t+1)^2 -1 \mbox{ , } -1 \le t < 0
:S(t) = 1 -(t-1)^2 \mbox{ , } 0 \le t \le 1
And actually I do not think much more should be said here. The (simple) definition is provided and the interesting part is then found in Spline interpolation, i.e the computation of the interpolating cubic spline!
Stamcose (talk) 19:55, 27 January 2011 (UTC)
thread_title:  Improvement of this article! 

message: A simple example of a quadratic spline (a spline of degree 2) is
 
:S(t) = (t+1)^2-1 \mbox{ , } -2 \le t < 0
:S(t) = 1-(t-1)^2\mbox{ , } 0 \le t \le 2
for which S'(0)=2.
An simple example of a cubic spline is
:S(t) = |t|^3 
as
:S(t) = t^3 \mbox{ , } t \ge 0 
:S(t) = -t^3 \mbox{ , } t < 0 
and
:S(0)^{(0)} = S(0) =  0 
:S(0)^{(1)} = S(0)' =  0 
:S(0)^{(2)} = S(0) =  0 
=== 2. Example ===
<quote>[...] S'(0)=2 [...] S(0)' =\ 0</quote>
What's "S(0)'"? Is it supposed to be "S'(0)" similiar to the first example and accourding to the normal notation of the 1. derivate of S?
-91.63.238.36 (talk) 13:06, 12 December 2012 (UTC)
thread_title: Examples

message: <quote>[...] S'(0)=2 [...] S(0)' =\ 0</quote>
What's "S(0)'"? Is it supposed to be "S'(0)" similiar to the first example and accourding to the normal notation of the 1. derivate of S?
-91.63.238.36 (talk) 13:06, 12 December 2012 (UTC)
thread_title:  2. Example 

message: ===Theory===
* Cubic Splines Module Prof. John H. Mathews California State University, Fullerton
* Spline Curves,  Prof. Donald H. House Clemson University
* An Interactive Introduction to Splines, ibiblio.org
* Introduction to Splines, codeplea.com
*
I added the external link to my free Web e-book.  It is a more complete treatment of piecewise interpolation for those new to the subject and aimed at graphics.  I'll add references to other related Wiki pages in the future. 
:EDIT Dec  29 2022 Comcast closed down web hosting.  My Interpolation e-book appears to be available on the archive: 
https://web.archive.org/web/20150930224506/http://home.comcast.net/~k9dci/site/?/page/Piecewise_Polynomial_Interpolation/  — Preceding unsigned comment added by EngineerSteve (talk • contribs) 00:27, 30 December 2022 (UTC)
replies: text: Category:Interpolation
End re-write
Stamcose (talk) 13:09, 29 January 2011 (UTC)
thread_title:  External links 

message: * Cubic Splines Module Prof. John H. Mathews California State University, Fullerton
* Spline Curves,  Prof. Donald H. House Clemson University
* An Interactive Introduction to Splines, ibiblio.org
* Introduction to Splines, codeplea.com
*
I added the external link to my free Web e-book.  It is a more complete treatment of piecewise interpolation for those new to the subject and aimed at graphics.  I'll add references to other related Wiki pages in the future. 
:EDIT Dec  29 2022 Comcast closed down web hosting.  My Interpolation e-book appears to be available on the archive: 
https://web.archive.org/web/20150930224506/http://home.comcast.net/~k9dci/site/?/page/Piecewise_Polynomial_Interpolation/  — Preceding unsigned comment added by EngineerSteve (talk • contribs) 00:27, 30 December 2022 (UTC)
thread_title: Theory

message: * 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
* Closed Bezier Spline, C#, WPF, Oleg V. Polikarpotchkin
* Bezier Spline from 2D Points, C#, WPF, Oleg V. Polikarpotchkin
 
:Category:Interpolation
End re-write
Stamcose (talk) 13:09, 29 January 2011 (UTC)
thread_title: Computer code

message: To my understanding this article is in a bad state! I already drafted above in "Improvement of article" what I think should be said.  What is more delicate is what not should be said. 
I think the text starting "Recall that a function.." should be removed! Seems to be completely misplaced and irrelevant. It says "is commonly denoted".  Please give references showing that anything of this is "common" at all in connection with splines (in serious work!)!
The "Algorithm for computing natural splines" and "clamped splines" is also misplaced(nonsense!?) In this article the definition what a spline is should be given but there is nothing to compute! For "Spline interpolation" there is something to compute but this is done completely different! 
I would like to remove all this dubious material!  Any protests?
Stamcose (talk) 19:40, 29 January 2011 (UTC)
thread_title:  Removal of dubious text 

message: The degree of the polynomial p(x) = a_0 + a_1x + a_2x^2 + ... is the largest k for which a_k is not zero.
In particular, the set of all polynomials of a given degree is not a linear vector space. For that reason, some people use the term "order" to indicate the number of consecutive terms, starting with a_0, a_1x, ... they are going to use to describe a polynomial. Thus, the set of all polynomials of order 4 is what some, carelessly, describe as the set of all cubic polynomials.
The same people would call a spline of order 4 what, in this article, is called a cubic spline or a spline of order 3. It would be good if the article were not to confuse order with degree. Deboor (talk) 03:26, 26 June 2011 (UTC)
thread_title:  degree vs order 

message: I was of the opinion, that I understand spline interpolation.
Last time I tried to implement this myself, I was successful in getting 0, 1, and 2nd derivative continuous.
But the resulting spline was widely oscillating -- going through the given points but oscillating around them
(0..2 derivative continuous)!
Then I tried things like modifying existing free parameters (1th derivative at point 0) to minimize the integral of the square of the second derivative. Or even adding more coefficients to minimize this integral. But without success. Oscillation was reduced strongly but got again out of control in the last couple of intervals.
Then I copied the implementation from Numerical recipes and everything was fine.
I've to state, that I don't like the explanation here in wikipedia or the one in numerical recipes.
Why not simply stating which things are given and what needs to be solved for?
given: 
* x1..xn, y1..yn, n >= 3
* dy/dx continuous
* d^2y/dx^2 continuous
* polynomial for every interval is 
* an+bn*x+cn*x^2+dn*x^3
or
*yn + bn*(x-xn) + cn*(x-xn)^2 + dn*(x-xn)^3 
This makes n points given and n-2 midpoints where the 0, 1 and 2nd derivative must be identical.
This is n+3*(n-2)=4n-6
need to be solved for:
* (n-1) intervals with 4 (polynomial) coefficients each, which is 4n-4 coefficients.
So we need two more given inputs -- maybe the 1 and 2nd derivative at the first point.
This gives a linear system with 4n-4 equations and 4n-4 unknowns.
Again: could somebody explain to me, what I'm doing wrong?
Why is my solution oscillating?
I don't see, how there could be more than one solution to this linear system.
18:35, 6 October 2015 (UTC)
thread_title:  my spline algorithm creates a oscillating curve -- why? 

message: User 71.246.201.83  on 13 April 2011 introduced some text (section "derivation") that in fact is the spline interpolation problem.  But this is already available and much better formulated in the article Spline interpolation. I think this text should be removed, possibly replaced with some clear reference to the article Spline interpolation!
Opinions?
Stamcose (talk) 16:53, 18 September 2011 (UTC)
replies: text: Yes, that makes sense: it doesn't really belong here, even without it already appearing in a far more appropriate article. Just replace it with a short paragraph and a  template.--JohnBlackburnewordsdeeds 18:47, 18 September 2011 (UTC)
thread_title:  Misplaced text 

message: Suspect typo in second sentence - "preferred to as". I believe this should be "preferred to" due to the comparison to polynomial interpolation, but since the change could change meaning I am requesting confirmation from others before editing. This could also use a reference i.e. preferred by whom?  — Preceding unsigned comment added by Jjensen2009 (talk • contribs) 00:37, 16 March 2012 (UTC)
thread_title:  Preferred to as? 

message: The introduction to the article currently reads:
 In mathematics, a spline is a sufficiently smooth polynomial function that is piecewise-defined, and possesses a high degree of smoothness at the places where the polynomial pieces connect (which are known as knots). 
There is nothing about the general spline that needs to be 'smooth', however, for example a linear spline is in no way smooth at knots.
I propose something to the extend of:
"In mathematics, a spline is a piecewise-defined polynomial function which defines a curve or line connecting a series of points (which are known as 'knots').  A linear, or first-order, spline is one in which each point is connected to the next with a straight line.  Higher order splines (e.g. quadratic, or 'second-order', splines) can be used to 'smooth' the connections between points." All Clues Key (talk) 05:10, 1 October 2012 (UTC)
thread_title:  'Smoothness' in introduction 

message: :
If splines are piecewise polynomials, this could be written better. —Tamfang (talk) 05:20, 27 September 2014 (UTC)
thread_title:  What's the difference? (again) 

message: I'm reading the article to try to understand how splines are defined, and I ran across this equation in the section "Algorithm for computing natural cubic splines":
*P_i \left (x_i \right) = y_i = P_{i-1}\left (x_i \right ), i = 1 , \ldots , n-1.
But doesn't this mean that the generated function - or more precisely, the endpoints of every single piece of the function - fall directly on the input points?  Sorry if I'm misunderstanding, I'm just learning about splines.  Russl5445 (talk) 20:51, 17 March 2021 (UTC)
thread_title:  Do the piecewise curves actually equal <math>y_i</math> ? 

message: I'm sorry but I would not call this pseudo code, a python or C example would be better. There are more explicit ways to write pseudo code.  — Preceding unsigned comment added by Jokooon (talk • contribs) 22:05, 3 December 2021 (UTC)
thread_title:  The pseudo code example is not helpful