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.2.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.2.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pythagore-1.2.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.2.0.tar.gz
Algorithm Hash digest
SHA256 01e68bb051491c08ac2f60d1b8ef0dc189deb63140484dcd3e18e1f7c9ae7a0b
MD5 5515bde4cbdb92acfc03cfd700e07eea
BLAKE2b-256 636a0dc268388db2fc62c28b637dd13caaaf1094811793cd76b907e666a7bb2a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pythagore-1.2.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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 261ae7a9721f61df98bd36266aa1e3696fdf583d65194b50f20429ee56c0e7a3
MD5 afa0439e23d21b36754cba698b91ed11
BLAKE2b-256 a03a864f01169e6e135eac4891f99d85aad57f56d9875a8c95908032182f8987

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