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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89e0b3f26c78379ca10ba812ace34d50272180a52a9b699ec8f90f57edd2472c
|
|
| MD5 |
fd151a4b0be1c35371370c7449ddffea
|
|
| BLAKE2b-256 |
25b1cfcbeac64c3d19fff1cd2490a057da6bfa43cf1b22815ac0ee370972c52d
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f5bb94e304094b9c91c74858c0569343d15c0761b0c37e937ee4305421f952c
|
|
| MD5 |
63819f64d2514ba63b79081515bb57cd
|
|
| BLAKE2b-256 |
399bb5f8140d492a66190a53323520b8f119003db5e239b04d638306f459e405
|