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

Function example_interpolation_lagrange

main.py:250–264  ·  view source on GitHub ↗

Run an example 'Interpolation: Lagrange'.

()

Source from the content-addressed store, hash-verified

248
249@print_docstring
250def example_interpolation_lagrange():
251 """Run an example 'Interpolation: Lagrange'."""
252 x = np.array([2, 11 / 4, 4])
253 y = np.array([1 / 2, 4 / 11, 1 / 4])
254 x_int = 3
255
256 print("Inputs:")
257 print(f"x = {x}")
258 print(f"y = {y}")
259 print(f"x_int = {x_int}")
260
261 y_int = interpolation.lagrange(x, y, x_int)
262
263 print("Output:")
264 print(f"y_int = {y_int:.5f}")
265
266
267@print_docstring

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected