Evaluating a spline derivative using splev in Scipy

I created bspline using splprep, as shown below, from a set of points:

tck,uout = splprep([x,y],s=0.,k=2,per=False) 

Now I am trying to evaluate the derivative of a spline using:

 dx,dy = splev(uout,tck,der=1) 

I find that splev returns two lists for the derivative.

Given that the spline is parameterized (say, in u), does it return dx / du and dy / du?

If not, how to properly evaluate the derivative (dy / dx)?

+4
source share
1 answer

Yes, if der = 1, the lists are the dx / du and dy / du values ​​at each point. Then the gradient is dy / dx = dy / du / dx / du.

I'm a little worried about calling splprep: s is optional, but if defined, it should have a value roughly the same as the number of dots (larger means smoother). per is an integer value, not a boolean. And cubic splines behave better than quadratic splines. http://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.splprep.html

+2
source

Source: https://habr.com/ru/post/1500292/


All Articles