Skip to main content

A Python library for polynomial interpolation, including Lagrange interpolation.

Project description

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 😄.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pollypocket-0.1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Pollypocket-0.1.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file pollypocket-0.1.0.tar.gz.

File metadata

  • Download URL: pollypocket-0.1.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for pollypocket-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7616982210d8ec8c3abb4667bb0332c4ee771d71e5599f90aa30e8ebacb5c5c7
MD5 30d4120403deac8cf49966b66cbb6c1c
BLAKE2b-256 2b17efc5c0b148b7b01c95b8fb70bc5cfb96b2aa8e4a6939ead15d0b4d7fb764

See more details on using hashes here.

File details

Details for the file Pollypocket-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: Pollypocket-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for Pollypocket-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b91d5b7ee827065b4419a5a489f40605dc18244d3f5b03edc6728aa44dc65171
MD5 8b1b204e47519ba28cc3466d532c29dd
BLAKE2b-256 5985dc13b83683a48ea7a46a3522b715f11e710291059c9dadb06fe308e606fc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page