Find all the sides and angles of a triangle, if you know some of the sides and/or angles. (Uses the Law of Sines and Law of Cosines.)
Project description
Written by Steven Byrnes, http://sjbyrnes.com/
Download: https://pypi.python.org/pypi/trianglesolver/ Source code repository: https://github.com/sbyrnes321/trianglesolver
This little package applies the law of sines or cosines to find all the sides and angles of a triangle, if you know some of the sides and/or angles.
The main function defined by this package is solve(…). Simple example:
from math import pi from trianglesolver import solve a,b,c,A,B,C = solve(b=7.6, c=8.3, A=pi/3)
Following the usual convention, lower-case letters are side lengths and capital letters are angles. Corresponding letters are opposite each other, e.g. side b is opposite angle B.
All angles are in radians! However, you can use the degree constant to convert:
from trianglesolver import solve, degree a,b,c,A,B,C = solve(b=7, A=5*degree, B=70*degree) print(C / degree)
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
File details
Details for the file trianglesolver-1.2.tar.gz
.
File metadata
- Download URL: trianglesolver-1.2.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4af18aade579d5c0d64389b3e65aeaf06cff26319762ccd859e3268559a76aea |
|
MD5 | bdefd4ab0e2020357c49b146cf757383 |
|
BLAKE2b-256 | 6f5218f909fcc652b2a4de75a274aa3de0d567a5d592b13d57e65b76c550bdf1 |
File details
Details for the file trianglesolver-1.2-py3-none-any.whl
.
File metadata
- Download URL: trianglesolver-1.2-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa0903c3708b4e2b496f06d490cae72c6ff6274b00d1edce420fcfa3b2b76682 |
|
MD5 | a30c514a2a22dec93d4bf2e983f8259b |
|
BLAKE2b-256 | ff8e43d45cf3e18e3f455e4b5ab333a7c27b8e38c4e535f7346b7148ce08eb65 |