Cubic spline. What is symmetrical form and why?

739 Views Asked by At

I'm trying to understand the algorithm for cubic spline from Wikipedia. It says the polynomial can be written in symmetrical form:

A third order polynomial $q(x)$ for which $q(x_1)=y_1$, $(x_2)=y_2$, $q'(x_1)=k_1$, $q'(x_2)=k_2$

can be written in the symmetrical form $$q =(1-t)y_1 + ty_2+ t(1-t) (a(1-t) + bt)$$ where $$t=\frac{x-x_1}{x_2-x_1}$$ $$a= k_1 (x_2 - x_1)-(y_2 - y_1)$$ $$b=-k_2 (x_2 - x_1)+(y_2 - y_1)$$

This is the first time I've come across this symmetrical form. I've searched online and am getting results about symmetric polynomials, but those seem to be something different (multivariate and switching variables has no effect). I've also encountered the symmetric equations for a line, but that doesn't help me at all in understanding this. I'm hoping someone can explain this symmetrical form and why it's helpful for understanding cubic spline theory.

1

There are 1 best solutions below

0
On

The polynomial comes from the substitution of $x = x(t) = (1 - t)x_1 + tx_2$ into $q(x)$, converting $q$ from a function of $x$ to a function of $t$. Note that $x(0) = x_1$ while $x(1) = x_2$. That is, it linearly translates the interval $[x_1, x_2]$ to $[0,1]$. This gives a standard formulation of $q$ on each interval.

As 5xum has noted, this standard formulation allows you to easily relate the coefficients of $q_{i-1}$ on $[x_{i-1}, x_i]$ with the coefficients of $q_i$ on $[x_i, x_{i+1}]$, which makes the calculation of those coefficients much easier.