Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Spline interpolation
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Example== [[Image:Cubic splines three points.svg|frame|right|Interpolation with cubic "natural" splines between three points]] In case of three points the values for <math>k_0, k_1, k_2</math> are found by solving the [[Tridiagonal matrix|tridiagonal linear equation system]] :<math> \begin{bmatrix} a_{11} & a_{12} & 0 \\ a_{21} & a_{22} & a_{23} \\ 0 & a_{32} & a_{33} \\ \end{bmatrix} \begin{bmatrix} k_0 \\ k_1 \\ k_2 \\ \end{bmatrix} = \begin{bmatrix} b_1 \\ b_2 \\ b_3 \\ \end{bmatrix} </math> with :<math>a_{11} = \frac{2}{x_1 - x_0},</math> :<math>a_{12} = \frac{1}{x_1 - x_0},</math> :<math>a_{21} = \frac{1}{x_1 - x_0},</math> :<math>a_{22} = 2 \left(\frac{1}{x_1 - x_0} + \frac{1}{{x_2 - x_1}}\right),</math> :<math>a_{23} = \frac{1}{{x_2 - x_1}},</math> :<math>a_{32} = \frac{1}{x_2 - x_1},</math> :<math>a_{33} = \frac{2}{x_2 - x_1},</math> :<math>b_1 = 3 \frac{y_1 - y_0}{(x_1 - x_0)^2},</math> :<math>b_2 = 3 \left(\frac{y_1 - y_0}{{(x_1 - x_0)}^2} + \frac{y_2 - y_1}{{(x_2 - x_1)}^2}\right),</math> :<math>b_3 = 3 \frac{y_2 - y_1}{(x_2 - x_1)^2}.</math> For the three points :<math>(-1,0.5),\ (0,0),\ (3,3),</math> one gets that :<math>k_0 = -0.6875,\ k_1 = -0.1250,\ k_2 = 1.5625,</math> and from ({{EquationNote|10}}) and ({{EquationNote|11}}) that :<math>a_1 = k_0(x_1 - x_0) - (y_1 - y_0) = -0.1875,</math> :<math>b_1 = -k_1(x_1 - x_0) + (y_1 - y_0) = -0.3750,</math> :<math>a_2 = k_1(x_2 - x_1) - (y_2 - y_1) = -3.3750,</math> :<math>b_2 = -k_2(x_2 - x_1) + (y_2 - y_1) = -1.6875.</math> In the figure, the spline function consisting of the two cubic polynomials <math>q_1(x)</math> and <math>q_2(x)</math> given by ({{EquationNote|9}}) is displayed.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)