euclipy

View the Project on GitHub joshuavaron/euclipy

Euclipy

PyPI version

PyPI downloads

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

Features:

solve():

Installation


# PyPi Installation

pip install euclipy

Sample Code (With Comments):

# Note: This is an implementation of Problem 17 from the 2016 AMC 12B Competition
from euclipy.polygon import Triangle
from euclipy.geometricobjects import Angle, Line, Segment

if  __name__ == '__main__':
    # Create a triangle
    Triangle('A C B')

    # Define lines within the triangle
    Line('A P Q H')
    Line('C P E')
    Line('B Q D')
    Line('A E B')
    Line('B H C')
    Line('C D A')
    
    # Define triangle edge measures
    Segment('A C').measure = 9
    Segment('C B').measure = 8
    Segment('A B').measure = 7
    
    # Create an altitude of Triangle(ACB)
    Angle('C H A').measure = 90
    
    # Create angle bisectors in Triangle(ACB)
    Angle('C B D').measure = Angle('D B A').measure
    Angle('E C B').measure = Angle('A C E').measure
    
    # Solve for and print the measure of Segment(PQ)
    print(Segment('P Q').solve())