MCPcopy Index your code
hub / github.com/cfgnunes/numerical-methods-python / example_interpolation_newton

Function example_interpolation_newton

main.py:268–282  ·  view source on GitHub ↗

Run an example 'Interpolation: Newton'.

()

Source from the content-addressed store, hash-verified

266
267@print_docstring
268def example_interpolation_newton():
269 """Run an example 'Interpolation: Newton'."""
270 x = np.array([0.1, 0.3, 0.4, 0.6, 0.7])
271 y = np.array([0.3162, 0.5477, 0.6325, 0.7746, 0.8367])
272 x_int = 0.2
273
274 print("Inputs:")
275 print(f"x = {x}")
276 print(f"y = {y}")
277 print(f"x_int = {x_int}")
278
279 y_int = interpolation.newton(x, y, x_int)
280
281 print("Output:")
282 print(f"y_int = {y_int:.5f}")
283
284
285@print_docstring

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected