{"id":28419,"library":"trianglesolver","title":"trianglesolver","description":"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.","status":"active","version":"1.2","language":"python","source_language":"en","source_url":"https://github.com/rsargent/trianglesolver","tags":["triangle","geometry","solver","math"],"install":[{"cmd":"pip install trianglesolver","lang":"bash","label":"Standard install"}],"dependencies":[],"imports":[{"note":"Function is named solve, not triangle_solve","wrong":"from trianglesolver import triangle_solve","symbol":"solve","correct":"from trianglesolver import solve"},{"note":"Used to convert degrees to radians; commonly missed","symbol":"degree","correct":"from trianglesolver import degree"}],"quickstart":{"code":"from trianglesolver import solve, degree\n# SSS case: sides a=3, b=4, c=5\na, b, c, A, B, C = solve(a=3, b=4, c=5)\nprint(f\"Angles: A={A:.2f}, B={B:.2f}, C={C:.2f}\")","lang":"python","description":"Solve triangle given three sides (SSS). Returns sides a,b,c and angles A,B,C in radians."},"warnings":[{"fix":"Convert using `from trianglesolver import degree` or multiply by 180/π.","message":"Angles are returned in radians, not degrees. Use the `degree` helper to convert or handle manually.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure you provide exactly three known values. For example: `solve(a=3, b=4, C=degree(90))`.","message":"The function `solve` requires exactly three arguments out of six possible (a,b,c,A,B,C). Missing or extra arguments will cause an error.","severity":"gotcha","affected_versions":"all"},{"fix":"Check if the input leads to ambiguous triangle; library may raise an exception or return unexpected results.","message":"No breaking changes known, but library is very simple and may not handle ambiguous cases (e.g., SSA) with clear errors.","severity":"deprecated","affected_versions":"1.x"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Always provide exactly three named arguments. Example: `solve(a=3, b=4, c=5)`","cause":"Calling solve() without providing any named arguments, or missing required arguments.","error":"ValueError: not enough values to unpack (expected 6, got 0)"},{"fix":"Verify your input forms a valid triangle. For angles, use the degree helper correctly.","cause":"Impossible triangle (e.g., sides violating triangle inequality) or out-of-range angle values.","error":"ValueError: math domain error"},{"fix":"Use `from trianglesolver import solve` instead of `from trianglesolver import trianglesolver`.","cause":"Trying to import the library name directly instead of the solve function.","error":"ImportError: cannot import name 'trianglesolver' from 'trianglesolver'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}