Euclipy

PyPI version PyPI downloads

A library used to create, model, and solve figures in Euclidean Geometry.

Features:

  • Create points, line segments, angles, and triangles with Point(), Segment(), Angle(), and Triangle(), respectively
  • Implicitly defines segments and angles created by polygon constructions
  • Keeps a registry of all defined objects, implicit or explicit

Installation

# PyPi Installation
pip install euclipy

Sample Code (With Comments):

from euclipy import Point, Triangle, Registry

# Create 3 unique points
A = Point('A')
B = Point('B')
C = Point('C')

# Create identical triangles
T1 = Triangle([A, B, C])
T2 = Triangle([B, C, A])

print(T1.edges)    # Prints line segments created by T1
print(T1.angles)    # Prints angles created by T1

# Tries to create inconsistent triangle
try:
    T3 = Triangle([B, A, C])
except:
    print('Inconsistent triangle')
    
# Prints all created objects
print(Registry().entries)

GitHub

View Github