Bidimensional
This package contains a collection of useful classes and functions for working with 2D geometry in Python.
Objectives and contributions
This package has three fundamental bases:
- Simplicity - The package is designed to be simple and easy to use, with a minimalistic approach to the implementation of its features.
- Rich documentation - The package is fully documented, with a detailed description of its features and their usage.
- Performance - The package is designed to be as fast as possible, mainly using simple algebraic operations instead of complex calculations.
Any contribution is welcome as long as it follows the objectives of the package. For more information, refer to the contributing guidelines.
Features
The following features are currently implemented:
Coordinate- A class for representing a 2D coordinate. It can be used to represent a point in the plane, or a vector from the origin. It provides with multiple access methods, as well as a set of useful methods for performing operations with other coordinates.polygons.Triangle- A class for representing a triangle in the plane. Contains several methods that can be used to compute its area, perimeter and relevant centers, as well as determining relevant properties of triangles (e.g. if they are equilateral, isosceles, etc.).functions.Spline- A class for representing a spline function. It can be used to interpolate a set of points in the plane and to compute the value of the function at any given point in between.operations- A module that contains relevant functions for performing operations with coordinates and triangles. It provides with functions for computing the distance between two points, the area of a triangle, the midpoint of a segment, etc.
Installation
The installation process is performed via PyPI (Python Package Index), so the package can be installed using the pip command.
pip install bidimensional
Refer to the PyPI release for more information about how to install the package in your system.
Usage
Once the package has been installed, its modules can be easily imported into custom programs via the import statement.
Examples
Composition of a small triangle out of the midpoints of the sides of a larger triangle, computation of the circumcircle of the inner triangle and figure plotting.
import bidimensional.operations as op
import matplotlib.pyplot as plt
from bidimensional import Coordinate
from bidimensional.polygons import Triangle
outer_triangle = Triangle(
Coordinate(0, 0),
Coordinate(1, 0),
Coordinate(0, 1)
)
inner_triangle = Triangle(
op.midpoint(outer_triangle.a, outer_triangle.b),
op.midpoint(outer_triangle.b, outer_triangle.c),
op.midpoint(outer_triangle.c, outer_triangle.a)
)
outer_triangle.plot(color="darkorange", lw=2)
inner_triangle.plot()
plt.gca().add_patch(plt.Circle(
inner_triangle.circumcenter,
inner_triangle.circumradius,
color="darkblue",
fill=False,
lw=2
))
plt.axis("equal")
plt.grid()
plt.show()
Metadata
Release files for bidimensional 1.9.1
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 |
|---|---|---|---|---|
| bidimensional-1.9.1.tar.gz | 51.5 kB | Without provenance | Details for bidimensional-1.9.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bidimensional-1.9.1-py3-none-any.whl | Python 3 | none | any | Details for bidimensional-1.9.1-py3-none-any.whl |
Total release size: 93.6 kB
Release files / bidimensional-1.9.1.tar.gz
| Download URL | bidimensional-1.9.1.tar.gz |
|---|---|
| Size | 51.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b180c22c0afc1079ce0c56f1aa82763448b87e08ac3f9f8d806185f150f0dd56
|
|
BLAKE2b-256 checksum How to use checksums |
eac1e02d2d431b14725cd06c10ef025c263ead735852a6984dc26f49895dc9e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / bidimensional-1.9.1-py3-none-any.whl
| Download URL | bidimensional-1.9.1-py3-none-any.whl |
|---|---|
| Size | 42.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
31d34e171e77affe8414e4d998d37709fd271e215246fc72443388729cee3cfd
|
|
BLAKE2b-256 checksum How to use checksums |
b8a14c4f13e5823f2d46ffb67f45b445e82e8385dc989ce970ec9cd06966f762
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Security for bidimensional 1.9.1
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.