Skip to main content

Math functions for 2D and 3D 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 Oblate

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.2.tar.gz (15.5 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.2-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyshaping-2.3.2.tar.gz
  • Upload date:
  • Size: 15.5 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.2.tar.gz
Algorithm Hash digest
SHA256 776d49749ac1d7889e97f03af5d385703458c1a3d8350955b3159bbfc4b0d5c7
MD5 930bf73329ccb08df4cd68c7b6715b80
BLAKE2b-256 e835148ddfaf1acf357a1cb691d2823bd1af6dd2e947b82ed77e3be05c6d1ddb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyshaping-2.3.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5f858f73f19e3c45382ceb3ce281ec971c3e59b3827e4f0acb12abcb79b086ea
MD5 d589779180fffae65d5b7e9d732f7164
BLAKE2b-256 9f5bf5d465de7e63f4cd1b924284edbed49094e9dd51a6277a148fa5d7d4a5c9

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