Skip to main content

A simple library to calculate anything and everything about circles and polygons.

Project description

clygon

Clygon is a library built to calculate everything from circles to polygons. You can calculate the interior angles of a polygon, or the area of any n-gon, and even the arc length, radius, or central angle of a circle.

To install the package, run pip install clygon in your terminal or cmd prompt.

How can I use it?

  1. Import the library - import clygon
  2. Instantiate the class:
eleven = clygon.Polygon(sides=11)
  1. Perform your calculations/attributes:
print("The shape is called:", eleven.name())
print("The sum of the interior angles is:", eleven.sum_of_interior_angles())
print(eleven.sum_of_interior_angles(exp=True))
print("

 The interior angles are", eleven.interior_angles())
print(eleven.interior_angles(exp=True))
  1. Run the code!

Example usage:

import clygon

eleven = clygon.Polygon(sides=11)
print("The shape is called:", eleven.name())
print("The sum of the interior angles is:", eleven.sum_of_interior_angles())
print(eleven.sum_of_interior_angles(exp=True))
print("

 The interior angles are", eleven.interior_angles())
print(eleven.interior_angles(exp=True))

fourtytwo = clygon.Polygon(sides=42)
print(fourtytwo.name())
print("if apothem=5, area =",fourtytwo.area(apothem=5))
print("if base=5, area =",fourtytwo.area(base=5))
print("if base=5, perimeter =",fourtytwo.perimeter(base=5))
print("ext. angles=",fourtytwo.exterior_angles())

Output:





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

clygon-0.0.4.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

clygon-0.0.4-py3-none-any.whl (5.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page