Skip to main content

allows you to solve the Pythagorean theorem in Python

Project description

pythagore

allows you to solve the Pythagorean theorem in Python

✨ Features

  • Calculate the hypotenuse from the two adjacent sides (a and b)
  • Calculate a missing side if the hypotenuse and another side are known
  • Check if a triangle is a right triangle by applying the Pythagorean theorem

🔧 Installation

You can install this module with pip:

pip install pythagore

🚀 Utilisation

Here is an example of using the module :

from pythagore import Pythagore

pythagore = Pythagore()

a = 3
b = 4
hypotenuse = pythagore.hypotenus(a,b) # hypotenus 

if pythagore.is_rectangle(hypotenuse, a, b) == True:
    print("the triangle is indeed right-angled according to the Pythagorean theorem")
else:
    print("the triangle is not a right triangle")

find_missing_side = pythagore.adjacent_side(hypotenuse, a) # 4
if find_missing_side == b:
    print(f"the missing side is b its value and : {find_missing_side}")

print()

print(f"hypotenus : {hypotenuse}\ncoter_a : {a}\ncote_b : {b}")

❗ Prerequisites

  • Python >= 3.13.0

📄 Licence

This project is distributed under the MIT License. See the LICENSE file for more information. LICENSE

Project details


Download files

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

Source Distribution

pythagore-1.1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pythagore-1.1.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file pythagore-1.1.0.tar.gz.

File metadata

  • Download URL: pythagore-1.1.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for pythagore-1.1.0.tar.gz
Algorithm Hash digest
SHA256 a42f273b0e8ffd58265b50e172efd382ede16c2d79004532aa0ca9bcbf99f755
MD5 2be3debc62edaa61bc19c0491b89f922
BLAKE2b-256 1e94af280b7120c54c04138f107b11b08ebb9825de99b260748c9cc61580ae9b

See more details on using hashes here.

File details

Details for the file pythagore-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: pythagore-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for pythagore-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b82baffe187b8418a748a72939eb9b6599df5118f57723260f2ea8d922c0a395
MD5 89fd8d19458f562e8669e139109fde89
BLAKE2b-256 c7bfc6c5350c3e71faf464022939391c0ed602d70cb8467ea3763bd88b4a1fc1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page