Skip to content

shapeAndSize — Plot & Compute Geometric Shapes in Python A Python library built with matplotlib for plotting and computing properties of geometric shapes like squares, triangles, rectangles, polygons, circles, and more. It’s perfect for students, teachers, and developers who want quick visualizations and shape calculations in one place.

Notifications You must be signed in to change notification settings

arupa444/matplotlibShapeAndSize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 

Repository files navigation

shapeAndSize Library

The ShapeAndSize library is a Python library built using matplotlib that allows users to plot various geometric shapes like squares, rectangles, triangles, and more based on user input. It also provides functionalities to calculate the area, perimeter, diagonal, and other properties of these shapes.

Features

  • Square: Plot and compute area, perimeter, and diagonal of a square.
  • Rectangle: Plot and compute area, perimeter, and diagonal of a rectangle.
  • Triangle: Plot and compute area, perimeter, and height of a triangle.
  • Equilateral Triangle: Plot and compute area, perimeter, and height of an equilateral triangle.
  • Parallelogram: Plot and compute area and perimeter of a parallelogram.
  • Rhombus: Plot and compute area, perimeter, and side of a rhombus.
  • Trapezoid: Plot and compute area, perimeter, and side of a trapezoid.
  • Kite: Plot and compute area, perimeter, and sides of a kite.
  • Regular Polygon: Plot and compute properties of polygons with any number of sides.
  • Semi-Circle: Plot and compute area, circumference, and diameter of a semi-circle.
  • Circle: Plot and compute area, circumference, and diameter of a circle.
  • Star: Plot a star shape.

Usage

Here's an example of how to use the ShapeAndSize library to plot a square:

from shapeAndSize import *
#for all the shapes

Plot a square with side length 5

from shapeAndSize import square
square.plot(5)

Square with length 5

Output

Square with length 5 plot

Plot a Triangle with sides 3,4,5

from shapeAndSize import traingle
triangle.plot(3,4,5)

Plot a Triangle with sides 3,4,5

Output

Plot a Triangle with sides 3,4,5

Rectangle with sides (20,30) ,marker-'*',LineStyle-'dotted' and color-'blue'

from shapeAndSize import *
rectangle.plot(20,30,'*','dotted','blue')

Rectangle with sides (20,30) ,marker-'*',LineStyle-'dotted' and color-'blue'

Output

Rectangle with sides (20,30) ,marker-'*',LineStyle-'dotted' and color-'blue'

Documentation

Square

Methods

  • plot(side, marker='none', linestyle='solid', color='m'): Plot a square with the specified side length, marker, linestyle, and color.
  • area(side): Calculate the area of the square.
  • perimeter(side): Calculate the perimeter of the square.
  • diagonal(side): Calculate the diagonal of the square.

Rectangle, Triangle, Equilateral Triangle, Parallelogram, Rhombus, Trapezoid, Kite, Regular Polygon, Semi-Circle, Circle, Star

Similar methods are available for each shape to plot and calculate their properties.

Contributing

We welcome contributions! If you have any ideas for improvements or new features, please submit a pull request or open an issue on GitHub.

License

This project is not yet licensed. I hadn't considered that yet.

About

shapeAndSize — Plot & Compute Geometric Shapes in Python A Python library built with matplotlib for plotting and computing properties of geometric shapes like squares, triangles, rectangles, polygons, circles, and more. It’s perfect for students, teachers, and developers who want quick visualizations and shape calculations in one place.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages