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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pythagore-1.4.1.tar.gz
Algorithm Hash digest
SHA256 188d4113bccbf4ea92e9b75a374e2030da51c9406ac6f1f3646df0b7ed1efc66
MD5 b64f14a97cfcdcfca2f251a6e52a98b1
BLAKE2b-256 acc4986427f95aeb0f17ee2b25ca9e91c5552c1947d3398333b5caf618ed6618

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pythagore-1.4.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.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 24750c649cd88a928e2f5ea9e67597923d26b277f6039aedaf7bc8d4edbc7707
MD5 cded188ec01cec8f9a01fc059aed4720
BLAKE2b-256 662456fab5d2cbc157341f2623a794b9e854bdb1a32918c4cdc7c1526f3fa096

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