splineEval(s, x)

Evaluates a spline.

sThe spline.
xEvaluation point.

The spline is represented as a matrix(-like object), where each row starts with l.h.s. end-point of the interval, and from the second element on, the polynomial coefficents are defined for the given interval. Technically it needs to be only a piece-wise polynomial, in particular [0 p] is technically a polynomial, where p is a usual polynomial.

s = [0, -1; 1, 2,0,0,0,0; 2, -1,0]; x0 = [-1, 0, .5, 1, 1.5, 2, 2.5, 3]; xmin = min(x0); xmax = max(x0); xeps = (xmax-xmin)/200; xmin -= 2*xeps; xmax += 2*xeps; x = xmin..xeps..xmax; [! x0; splineEval(s,#x0) !] plot(x,splineEval(s,#x))