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

A simple solver for trigonometric equations.

Project Description

triangles is a package for easily solving simple trigonometric equations. It contains only a single function which takes the name of the sought side length, an angle in degrees and a side length as seen from that angle. It returns the length of the sought side.

The sought side must be a member of ["adjacent", "opposite", "hypotenuse"].

The solve function returns either the the value the solved equation would return, or the equation required to solve the problem given the provided data or, if the solve flag is set to False.

Usage:

>>> from triangles import solve
>>> solve("adjacent", 60, hypotenuse=1000)
500.0000000000001
>>> solve("adjacent", 60, hypotenuse=1000, solve=False)
'hypotenuse * math.cos(angle)'
>>> solve("opposite", 53, adjacent=7)
9.289313751342869
>>> solve("opposite", 53, adjacent=7, solve=False)
'adjacent * math.tan(angle)'
>>> solve("hypotenuse", 68, opposite=70)
75.49743198743084
>>> solve("hypotenuse", 68, opposite=70, solve=False)
'opposite / math.sin(angle)'

triangles is maintained by Daniel Lee and is released under the GNU Greater Public License. If you’re interested in contributing, fork the project on Github! Please let me know if you use it for anything especially interesting.

Release History

Release History

This version
History Node

0.2.1

History Node

0.2.0

History Node

0.1.4

History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
triangles-0.2.1.tar.gz (2.2 kB) Copy SHA256 Checksum SHA256 Source Aug 6, 2013

Supported By

WebFaction WebFaction Technical Writing 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 Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting