Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

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,

Download: Source code repository:

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)

Release History

History Node


This version
History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(4.4 kB) Copy SHA256 Hash SHA256
Source None Jul 2, 2014

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers