# Smoothly Interpolating a Set of Data

Smoothly Interpolating a Set of Data

This Demonstration lets you compare piecewise quadratic interpolation with a little-known variation of it that always gives a smooth interpolation function. This means that for this function derivatives of all orders exist. Smoothness is achieved by joining neighboring quadratic interpolation polynomials by means of a smooth sigmoid function that depends on a positive parameter . This sigmoid is given by a surprisingly simple formula:

σ(x)

s

σ(x)=

0 | x≤0 |

1/(1+exp(s(1/x+1/(x-1)))) | 0<x<1 |

1 | x≥1 |

The checkbox allows you to toggle between smooth interpolation and piecewise quadratic interpolation. The Locator points can be shifted, deleted, or new points can be created. This allows you to test a variety of interpolation situations. The sigmoid function is always shown below the graphical representation of the interpolated function. Pale colors in this representation indicate that the function presently runs idle since the interpolation mechanism is not selected as smooth in the checkbox. The parameter s has always the value which is selected by the slider. Variation of s can be seen to change the curve σ considerably but rarely has much effect on the interpolation.