Write a function interpolate_function(function, limit, points, int_style) which takes function (a function object), limi
Posted: Fri Jun 10, 2022 11:55 am
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