Skip to content

hossein-sartipi/Lagrange-Interpolation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

12 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿงฎ Lagrange Interpolation Calculator

This Python script calculates the Lagrange Interpolation Polynomial for a given set of points.
It's a step-by-step, interactive CLI tool that helps you compute the interpolation and visualize the resulting simplified polynomial.

๐ŸŽฅ Demo

Lagrange Demo


๐Ÿ“Œ Features

  • Interactive input of (x, y) points
  • Eliminates duplicate entries
  • Constructs the Lagrange basis polynomials
  • Outputs the final simplified interpolation polynomial in human-readable math format using SymPy

๐Ÿ› ๏ธ Requirements

  • Python 3.6+
  • sympy library

Install with:

pip install sympy

๐Ÿš€ How to Use

Run the script:

python lagrange_interpolation.py

Then enter your data points interactively:

x_0: 1
y_0: 2
x_1: 2
y_1: 3
x_2:
wanna break?Y/N: Y

The result will be printed in a simplified algebraic form, such as:

x + 1

๐Ÿ“„ License

This project is licensed under the MIT License.

About

Interactive Lagrange Polynomial Generator in Python

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages