.
Xamarin
GDI+ FAQ
Skip Navigation Links

What is a Cardinal Spline?

This oddly named thing is simply a line with tension. A set of X,Y coordinates can be used to make a polygon or poly-line. Usually the points are connected by straight-line segments. A Cardinal Spline takes the positions of the current point and,along with the previous and next points, averages out the positions using a tension value. This smoothes the line and makes a path that is gently curved through the points rather than zigzagging through them. Figure 1 shows a cardinal spline drawn through several points. The black dots are the nodes, the lines are the curves generated by several different representations of the line at different tensions.

The red line has zero tension. The Indigo line has a tension of 1. The others are something in-between.

Figure 1. A selection of Cardinal Splines drawn with DrawCurve.

Return to the article.

Bob Powell

Create your badge

Copyright ©Bob Powell 2000-2014. All rights reserved.