Skip to main content

calculation for various shapes

Project description

PyShaping Library

A python module for math lovers or just people who needs it.

Introduction

The module can calculate the Areas and Perimeters of 2D shapes.
The module can calculate the Volumes and Surface Areas of 3D shapes.
The module is lightweight, and only requires the python built-in math library.

Every function is stored in a shape class.

Cool Features

There are functions for 5-point stars' area calculation!
There are functions for ellipsoids and spheroids' surface area calculation!
There are functions for ellipse's perimeter calculation!

2D Shapes

There are various shapes!
Including:

  • Square
  • Rectangle
  • Triangle
  • Rhombus
  • Parallelogram
  • Kite
  • Circle
  • Trapezoid
  • Ellipse
  • Pentagon (5 side) ~ Dodecagon (12 side)
  • Starfish (5-point star shape)

Usage:

from pyshaping import Pentagon

shape = Pentagon(side=10)
print(f"Area of pentagon with side length 10 is {shape.area()}")
print(f"Perimeter of pentagon with side length 10 is {shape.perimeter()}")

3D Shapes

There are again, various objects you can use!
Including:

  • Cube
  • Prisms (Triangular ~ Dodecagonal)
  • Sphere
  • Hemisphere
  • Sphere Cap
  • Spheroid (Oblate & Prolate)
  • Ellipsoid
  • Torus (Donut shape)
  • Sausage (Wiener Sausage shape)

Usage:

from pyshaping import Pentagon

shape = Oblate(radius=15, halfheight=5)
print(f"Volume of the oblate spheroid is {shape.volume()}")
print(f"Surface area of the oblate spheroid is {shape.surface()}")

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

pyshaping-2.3.1.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

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

pyshaping-2.3.1-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file pyshaping-2.3.1.tar.gz.

File metadata

  • Download URL: pyshaping-2.3.1.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.2

File hashes

Hashes for pyshaping-2.3.1.tar.gz
Algorithm Hash digest
SHA256 89e0b3f26c78379ca10ba812ace34d50272180a52a9b699ec8f90f57edd2472c
MD5 fd151a4b0be1c35371370c7449ddffea
BLAKE2b-256 25b1cfcbeac64c3d19fff1cd2490a057da6bfa43cf1b22815ac0ee370972c52d

See more details on using hashes here.

File details

Details for the file pyshaping-2.3.1-py3-none-any.whl.

File metadata

  • Download URL: pyshaping-2.3.1-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.2

File hashes

Hashes for pyshaping-2.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1f5bb94e304094b9c91c74858c0569343d15c0761b0c37e937ee4305421f952c
MD5 63819f64d2514ba63b79081515bb57cd
BLAKE2b-256 399bb5f8140d492a66190a53323520b8f119003db5e239b04d638306f459e405

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