def test_basic_parser(): link(A, B) link(A, C) link(B, C) set_angle('ABC', 90) set_angle('ACB', 30) assert get_angle('BAC') == 60 clear()
def test_parser_example2(): link(A, B, C, E) link(B, D) link(D, E) set_angle('ABD', 120) set_angle('BDE', 30) set_length('BD', 210) result = get_length('DE') assert abs(result - (3**(1/2) / 2) * 210) < 1e-6 clear()
def test_parser_example3(): link(A, B) link(A, F) link(A, D) link(A, C) link(B, F, D, C) set_angle('ABC', 36) set_angle('ACB', 76) split_angle('BAC', 'AF', ratio=0.5) set_common_vertex_angles('A', ['B', 'F', 'D', 'C']) perpendicular('AD', 'BC') assert round(get_angle('DAF'), 6) == 20 clear()
def test_advanced_parser(): link(A, D, B) link(A, E, C) link(D, F, C) link(B, F, E) link(B, C) set_angle('BAC', 45) set_angle('ABE', 40) set_angle('ACD', 20) assert round(get_angle('EFC'), 6) == 75 clear()
def test_parser_example1(): link(A, D) link(A, B) link(A, E, C) link(B, E, D) link(B, C) set_angle('BAC', 60) set_angle('ACB', 30) set_angle('ADB', 45) set_angle('ABD', 45) set_angle('BAD', 90) set_angle('ABC', 90) assert round(get_angle('AEB'), 6) == 75 clear()