Registry / data / trianglesolver

trianglesolver

JSON →
library1.2pypypi✓ verified 88d ago

A Python library for solving triangles (finding all sides and angles) using the Law of Sines and Law of Cosines. Current version is 1.2, released with no recent updates.

pip install trianglesolver
INSTALL
IMPORT
SIG · TRIANGLESOLVER
T
trianglesolver
datapythonv1.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

solve
✓ from trianglesolver import solve
✗ from trianglesolver import triangle_solve
Function is named solve, not triangle_solve
degree
✓ from trianglesolver import degree
Used to convert degrees to radians; commonly missed

Solve triangle given three sides (SSS). Returns sides a,b,c and angles A,B,C in radians.

from trianglesolver import solve, degree # SSS case: sides a=3, b=4, c=5 a, b, c, A, B, C = solve(a=3, b=4, c=5) print(f"Angles: A={A:.2f}, B={B:.2f}, C={C:.2f}")
Debug
Known issues
gotchaAngles are returned in radians, not degrees. Use the `degree` helper to convert or handle manually.
fix
Convert using `from trianglesolver import degree` or multiply by 180/π.
affects: all
gotchaThe function `solve` requires exactly three arguments out of six possible (a,b,c,A,B,C). Missing or extra arguments will cause an error.
fix
Ensure you provide exactly three known values. For example: `solve(a=3, b=4, C=degree(90))`.
affects: all
deprecatedNo breaking changes known, but library is very simple and may not handle ambiguous cases (e.g., SSA) with clear errors.
fix
Check if the input leads to ambiguous triangle; library may raise an exception or return unexpected results.
affects: 1.x
Errors
Common errors & fixes
ValueError: not enough values to unpack (expected 6, got 0)
Calling solve() without providing any named arguments, or missing required arguments.
fix
Always provide exactly three named arguments. Example: `solve(a=3, b=4, c=5)`
ValueError: math domain error
Impossible triangle (e.g., sides violating triangle inequality) or out-of-range angle values.
fix
Verify your input forms a valid triangle. For angles, use the degree helper correctly.
ImportError: cannot import name 'trianglesolver' from 'trianglesolver'
Trying to import the library name directly instead of the solve function.
fix
Use `from trianglesolver import solve` instead of `from trianglesolver import trianglesolver`.
Upgrade
Version history
1.2latest on PyPI · released Apr 10, 2020
Audit
Dependencies

No dependency data recorded yet.

Agent activity
17 hits · last 30 days
node
14
Amazon
1
OpenAI (training)
1
Resources
trianglesolver — pip install trianglesolver · libregistry