Math for Cannibals
This Python package provides mathematical functions to automate calculations, particularly for right triangles.
Table of Contents
- Installation
- Practical Information
- Usage
- Contributing
- License
Installation
To install the package, run the following command:
pip install math_for_cannibals
Practical Information
When using the class, you will be prompted to provide values for a
, b
, and c
. These values represent the sides and angles of a right triangle, defined as follows:
If the image is not rendered, you can view it here.
Usage
Table of Contents
- Configuring the Class
- Using the Class
- Retrieving Calculated Values
Configuring the Class
The class responsible for the calculations is configured like this:
from math_for_cannibals.RightTriangle import RightTriangle
Rt = RightTriangle(aSide, bSide, cSide, aDegree, bDegree)
Here’s an example:
Rt = RightTriangle(aDegree=20)
Using the Class
You can use the class by entering the information you know about the triangle. The following are some example usages:
Rt = RightTriangle(aDegree=20)
Rt = RightTriangle(aSide=2, bSide=3)
Rt = RightTriangle(aDegree=20, aSide=2)
Retrieving Calculated Values
To get the calculated angles and sides of the triangle, you can use the following methods:
Rt = RightTriangle(aDegree=20)
Rt.get_degrees()
The class has three main methods:
get_degrees()
- Returns only the angles of the triangle.get_sides()
- Returns only the sides of the triangle.get_triangle()
- Returns both the sides and angles of the triangle.
Contributing
Contributions are welcome! Please send an email explaining your proposed improvements to ensure clarity.
Be sure to update tests as needed.
License
MIT