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.0.0.tar.gz (3.1 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.0.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pythagore-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5b27fcdd6149c3dc7d6f8c123a7ab66e8f5850481a21e482e69710c3a1aead6c
MD5 a02b0de38a591f78e9003127ca90335c
BLAKE2b-256 e64ffc3cc1630bf980bab11dd032b9ccd75254ab904300b2ee4e8f04bbf874e8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pythagore-1.0.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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 57c74e79821574e549c5f690f304b1b896ebf95670b5a7c76a0acb11956517c7
MD5 965dff308a150b3045155d2b11b1d89c
BLAKE2b-256 a1b5e1c57869a5731240f3676f5104f914af6841b7325c3ec7e9476f36fd8031

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