planetriangles
Mostly you will use:
err_msg, a, b, c, A, B, C = complete_the_triangle(a, b, c, A, B, C)
This is the main routine in the plane_triangles.py module. Its input parameters default to None.
It solves (if possible) for the missing sides and/or angles in the parameter list.
If two solutions are possible, it will indicate this by a return value in err_msg that starts with “Other”. The first answer should be used, then a request made for the return of the second by repeating the original call with the ssa_flag set to 'other', i.e.
err_msg, a, b, c, A, B, C = complete_the_triangle(a, b, c, A, B, C, ssa_flag=’other’)
Installation
pip install planetriangles
Then, to get started, from a python REPL you can run the exerciser with …
>>> from planetriangles.exerciser import run_ui >>> run_ui()
Load the user functions with …
>>> from planetriangles.plane_triangles import *
All of the exported functions have help text included. So you can get help with the usual help(complete_the_triangle) method. There are a number of formatting routines for converting angles to various forms (radians, degrees, degrees and minutes, degrees minutes seconds) with a specified precision.
The module (plane_triangles_tests.py) contains a set of tests. It uses assert statements to detect errors. Importing the module will run the tests. All is well when no assert throws an exception.
There is an interactive test/excercise program that can be invoked by importing and executing run_ui() from the module excerciser.py. To get it started, do this …
>>> from planetriangles.exerciser import run_ui >>> run_ui()
It starts with a prompt that allow one to set the desired format for the display of angles (radians, degrees, degrees and minutes, degrees and minutes and seconds).
The next two prompts allow the precision (number of digits to right of decimal point) for angles and lengths to be specified.
A loop is then entered that prompts for the sides and angles to be used. Just press enter to indicate that a value will not be provided (i.e., is to be calculated).
If all six parameters are left empty, the loop terminates.
Example
>>> from planetriangles.exerciser import run_ui() >>> run_ui() . Session started... . Angle format to use [r, d, dm, dms]: d Angle precision (digits to right of decimal point) to use: 4 Length precision (digits to right of decimal point) to use: 4 . Side a: 1 Side b: 1 Side c: Angle A (degrees): Angle B (degrees): Angle C (degrees): 90 a: 1.0000 b: 1.0000 c: 1.4142 A: 45.0000d B: 45.0000d C: 90.0000d
Metadata
Release files for planetriangles 1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| planetriangles-1.1-py3-none-any.whl | Python 3 | none | any | Details |
Release files / planetriangles-1.1-py3-none-any.whl
| Download URL | planetriangles-1.1-py3-none-any.whl |
|---|---|
| Size | 10.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a64537ea52aa31e27510b53c554f793c21b922b582a6a3628c2a17791c7700f5
|
|
BLAKE2b-256 checksum How to use checksums |
ef8152c24e4d60ba5e566153cd819049dad63331baa52d8ff9490d39bd7b01eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.4
|