- Write A Function Interpolate Function Function Limit Points Int Style Which Takes Function A Function Object Limi 1 (94.9 KiB) Viewed 124 times
Write a function interpolate_function(function, limit, points, int_style) which takes function (a function object), limi
-
- Posts: 43759
- Joined: Sat Aug 07, 2021 7:38 am
Write a function interpolate_function(function, limit, points, int_style) which takes function (a function object), limi
Write a function interpolate_function(function, limit, points, int_style) which takes function (a function object), limit (x-axis boundary, float), points (the number of interpolated points, integer) and int_style (interpolation style as string), and returns the interpolated points (it is of numpy array type). Note: no visualisation is required. For example: Test Result print (interpolate_function(np.sin, 2 * np.pi, 20, 'cubic')) [ 0.00 9.69 4.75 -7.35 -8.35 print (interpolate_function(np.sin, 2 * np.pi, 15, 'linear')) [ 0.00 9.16 -4.16 -7.40 10 O