MCPcopy Create free account
hub / github.com/google-deepmind/alphageometry / maybe_make_equal_pairs

Function maybe_make_equal_pairs

problem.py:645–673  ·  view source on GitHub ↗

Make a-b:c-d==m-n:p-q in case a-b==m-n or c-d==p-q.

(
    a: gm.Point,
    b: gm.Point,
    c: gm.Point,
    d: gm.Point,
    m: gm.Point,
    n: gm.Point,
    p: gm.Point,
    q: gm.Point,
    ab: gm.Line,
    mn: gm.Line,
    g: Any,
    level: int,
)

Source from the content-addressed store, hash-verified

643
644
645def maybe_make_equal_pairs(
646 a: gm.Point,
647 b: gm.Point,
648 c: gm.Point,
649 d: gm.Point,
650 m: gm.Point,
651 n: gm.Point,
652 p: gm.Point,
653 q: gm.Point,
654 ab: gm.Line,
655 mn: gm.Line,
656 g: Any,
657 level: int,
658) -> list[Dependency]:
659 """Make a-b:c-d==m-n:p-q in case a-b==m-n or c-d==p-q."""
660 if ab != mn:
661 return
662 why = []
663 eqname = 'para' if isinstance(ab, gm.Line) else 'cong'
664 colls = [a, b, m, n]
665 if len(set(colls)) > 2 and eqname == 'para':
666 dep = Dependency('collx', colls, None, level)
667 dep.why_me(g, level)
668 why += [dep]
669
670 dep = Dependency(eqname, [c, d, p, q], None, level)
671 dep.why_me(g, level)
672 why += [dep]
673 return why
674
675
676class Dependency(Construction):

Callers 1

why_meMethod · 0.85

Calls 2

why_meMethod · 0.95
DependencyClass · 0.85

Tested by

no test coverage detected