What’s a Spline?

Print anything with Printful



Splines are piecewise polynomial functions used in interpolation, computer graphics, and CAD. Polynomial interpolation is used for small data sets, but spline interpolation is better for larger sets. Spline interpolation techniques include linear, quadratic, and cubic interpolation. Linear interpolation fits straight lines between data points, quadratic interpolation fits quadratic equations, and cubic interpolation fits third-order polynomial functions.

A spline is a type of piecewise polynomial function. In mathematics, splines are often used in a type of interpolation known as spline interpolation. Spline curves are also used in computer graphics and computer aided design (CAD) to approximate complex shapes.
Interpolation is used when there is a set of discrete data points and other points of the same data type need to be estimated from the data points. Polynomial interpolation is commonly used for a small number of data points; this is a method that fits an n order polynomial function at n + 1 data points. As the number of points gets larger, however, polynomial interpolations often don’t fit the data well. In these cases, spline interpolation is often used.

While polynomial interpolation fits a curve through all data points simultaneously, spline interpolation fits a curve between each neighboring pair of data points and sums all the curves to create the final approximation. This is why splines are piecewise functions rather than smooth curves. Commonly used spline interpolation techniques include linear, quadratic, and cubic interpolation.

Spline linear interpolation simply fits straight lines through each consecutive pair of data points. Each section of line can have a similar or very different slope from the other section, depending on the distribution of the data. To find the y-value on a Cartesian coordinate system for a given x-value between two data points, the slope between the data points is multiplied by the distance between the x-value for which you want the y-value and the x-value for the point from his left. This number is then added to the y value to the left of the desired location to approximate the y value between the two points.

Quadratic spline interpolation approximates data between consecutive points using a quadratic polynomial. To find the coefficients of these quadratic equations, several methods can be applied to solve simultaneous equations. Linear algebra techniques or solving using computer software are some of the more common techniques used. An interpolated y value on a quadratic spline is found using the general quadratic equation, y = a*x2 + b*x + c, with the coefficients a, b and c previously determined.

Cubic spline interpolation uses a cubic or third-order polynomial function to approximate data between consecutive points. This type of spline is usually calculated using computer software or a graphing calculator. A special type of cubic spline interpolation, called locked or full spline interpolation, uses the slopes provided at the ends of the curve to help calculate the function.




Protect your devices with Threat Protection by NordVPN


Skip to content