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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pythagore-1.3.1.tar.gz
Algorithm Hash digest
SHA256 bfe10f67568df6283dcbc9311b84a416ea19a2344aa1afdc70e418c7c11c7c00
MD5 c6d806b5d4eafd17b86d2ef0ca49591a
BLAKE2b-256 70c69320094b0af5331d7d5e851018cb2ff72d9324f0f4a5dc7ecbca0d88c2ac

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pythagore-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f842719bc6bc587182c0ab36c2c37758180bf6a2031e27384dff8fc18b6eee27
MD5 7d5a3ff64b3c5b54c5e9713a81ba53dd
BLAKE2b-256 12f089b4d716541ff2b17feb5ddc03822312c91fe7280baf81a8f6bf4e29f866

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