Skip to main content

Bidimensional

PyPI release Python Test Execution

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)

Source distribution for bidimensional 1.9.1
File Size Uploaded
bidimensional-1.9.1.tar.gz 51.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bidimensional 1.9.1
File Interpreter ABI Platform
bidimensional-1.9.1-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

1.9.1 This release

2 release files

1.9.0

2 release files

1.8.0

2 release files

1.7.0

2 release files

1.6.10

2 release files

1.6.9

2 release files

1.6.8

2 release files

1.6.7

2 release files

1.6.5

2 release files

1.6.4

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.3.1

2 release files

1.3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page