Pyntegrals
Pyntegrals is a simple library for computing a definite integral over a 2D polygonal domain.
At the moment the only function of the library is integrate_over_polygon, which perform the calculation.
It is possible that in the future other functions will be added.
pyntegrals.integrals
pyntegrals.integrals.integrate_over_polygon
pyntegrals.integrals.integrate_over_polygon(function: Union[Callable, float], polygon: list[tuple]) -> float
Computes the integral of a two-variables function over a polygonal domain in R2.
Returns the definite integral of function(x, y) = f(x, y) over
polygon = Σ, that is:
Parameters
function : Union[Callable, float]
polygon: list[tuple]
Returns
r : float
function(x, y) over polygon.
Example
Compute the integral of x2 + y over a 50 x 40 rectangle Σ with a vertex in (0, 0) and another in (50, 40)
from pyntegrals.integrals import integrate_over_polygon
polygon = [(0, 0), (50, 0), (50, 40), (0, 40)]
rho = lambda x, y: x**2 + y
mass = integrate_over_polygon(function=rho, polygon=polygon)
>>> 1706666.666666667
For more example see examples/example.py
Metadata
Release files for pyntegrals 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyntegrals-1.0.0.tar.gz | 39.4 kB | Without provenance | Details for pyntegrals-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyntegrals-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for pyntegrals-1.0.0-py3-none-any.whl |
Total release size: 67.7 kB
Release files / pyntegrals-1.0.0.tar.gz
| Download URL | pyntegrals-1.0.0.tar.gz |
|---|---|
| Size | 39.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eceeac2f715c8aeaa805a167a2f2c3884e5f86737cfe61e3f66acd561e6d22b3
|
|
BLAKE2b-256 checksum How to use checksums |
2e1104a260ec96313121b176e33bef64109f7d26cc4021e91c6ccb8f2ba979d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.9
|
Release files / pyntegrals-1.0.0-py3-none-any.whl
| Download URL | pyntegrals-1.0.0-py3-none-any.whl |
|---|---|
| Size | 28.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
48ae01166059ee369102e044761b49809247b89ab61524c2f49f00a20295f06e
|
|
BLAKE2b-256 checksum How to use checksums |
18ac35cbe628da453352a5bc54adb9741bb4807cda78f586e5d0c14541a5d5f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.9
|
Security for pyntegrals 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.