Simple Python package that can be used to do calculations with right-angled triangles
Project description
Right Triangle
Simple Python package that can be used to do calculations with right-angled triangles
Installation
Use pip to install right-triangle.
pip install right-triangle
Usage
The RightTriangle instance
A RightTriangle instance has 5 attributes:
- a - the length of the first leg of the triangle
- b - the length of the second leg of the triangle
- c - the length of the hypotenuse of the triangle
- a_angle - the angle opposed to leg a, measured in degrees
- b_angle - the angle opposed to leg b, measured in degrees
You can instantiate a RightTriangle with the following information:
- The lengths of any two sides of the triangle
- One angle and the length of one side of the triangle
During the instantiation the other attributes are calculated and become accessible.
Example
from right_triangle import RightTriangle
# Instantiate a RightTriangle with some of the attributes
rt = RightTriangle(a=3, b=4)
# The other attributes are accessible
print(rt.c)
print(rt.a_angle)
print(rt.b_angle)
# Instantiation with other attributes
rt2 = RightTriangle(c=10, a_angle=rt.a_angle)
print(rt2.a)
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
right-triangle-0.1.0.tar.gz
(2.6 kB
view hashes)
Built Distribution
Close
Hashes for right_triangle-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f19819a3f13ac74b613685815b3009f21418c41581dbb46dad212e20f3a91ed |
|
MD5 | a3ccd6b088140c86623c06a4649c6275 |
|
BLAKE2b-256 | b2490ff0725cc2f718d42be410852933b722b26a9b02a110fbc8efaa1cfbe8b1 |