Skip to content

adechlien/Pollypocket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pollypocket

Description

Pollypocket is a Python library for calculate and solve lagrange interpolation polynomials.

Dependencies

  • Sympy: A Python library for symbolic mathematics.

Installation and Usage

Install the library using the terminal:

pip install pollypocket

Then, import it in your python project:

import pollypocket as pyp

Lagrange Polynomial Interpolation

Parameters

  • points: A list of tuples, where each tuple contains a point in the form $(x_i, y_i).
>>> import pollypocket as pyp
>>> points = [[1, 3], [2, 1], [3, 5]]
>>> lagrange_polynomial = pyp.lagrange_polynomial(points)
>>> print(lagrange_polynomial)
3*x**2 - 11*x + 11

Evaluate Polynomial

Parameters

  • expression: The polynomial expression in string format. This is created using the lagrange_interpolation function.
  • x: The value at which the polynomial is to be evaluated.
>>> import pollypocket as pyp
>>> points = [[1, 3], [2, 1], [3, 5]]
>>> lagrange_polynomial = pyp.lagrange_polynomial(points)
>>> value = pyp.evaluate_polynomial(lagrange_polynomial, 2)
>>> print(value)
1.0

How to contribute

Feel free to contribute to this project by forking the repository and creating a pull request. You can also create an issue if you find any bugs or want to suggest a new feature 😄.

About

Python Library for solving Lagrange Interpolation Problems

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages