Interpolate bank, which is in the SciPy, provides lots of ways to do the interpolation operation.
Here is an example of interpolation with directed line and B-Spline to fix the point on a sine wave.
In this program, we use the interp1d function to get a new linear interpolation function. Splrep function is used to calculate the parameters in B-Spline Curves, then transfer them to splev function to realize the interpolation operation.
Here is the code and the result.
1 |
# -*- coding: utf-8 -*- |
Definition of Interpolate.
- To Be Continue
近期评论