[SciPy-User] basic spline interpolation in a few lines of numpy
Mon Dec 21 11:48:47 CST 2009
I've put a couple of tiny spline functions in http://advice.mechanicalkern.com;
their aim is to help students get started with splines, with the aid
(They may, though, interpolate between two stools: unclear for
beginners, trivial for experts.)
""" basic spline interpolation in a few lines of numpy.
Keywords: interpolate, resample, B-spline, Catmull-Rom, numpy, getting-
t = arange( 1000+1 )
points = f(t) # points in 1d 2d 3d ...
curve = dotspline1( points, times=10 ) # at 0 .1 .2 ... 999.9
surface = dotspline2( array, times=10 ) # an array of e.g. pixels
More information about the SciPy-User