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

Function match_perp_perp_npara_eqangle

dd.py:143–167  ·  view source on GitHub ↗

Match perp A B C D, perp E F G H, npara A B E F => eqangle A B E F C D G H.

(
    g: gh.Graph,
    g_matcher: Callable[str, list[tuple[gm.Point, ...]]],
    theorem: pr.Theorem,
)

Source from the content-addressed store, hash-verified

141
142
143def match_perp_perp_npara_eqangle(
144 g: gh.Graph,
145 g_matcher: Callable[str, list[tuple[gm.Point, ...]]],
146 theorem: pr.Theorem,
147) -> Generator[dict[str, gm.Point], None, None]:
148 """Match perp A B C D, perp E F G H, npara A B E F => eqangle A B E F C D G H."""
149 dpairs = []
150 for ang in g.vhalfpi.neighbors(gm.Angle):
151 d1, d2 = ang.directions
152 if d1 is None or d2 is None:
153 continue
154 dpairs.append((d1, d2))
155
156 for (d1, d2), (d3, d4) in utils.comb2(dpairs):
157 a, b = g.two_points_on_direction(d1)
158 c, d = g.two_points_on_direction(d2)
159 m, n = g.two_points_on_direction(d3)
160 p, q = g.two_points_on_direction(d4)
161 if g.check_npara([a, b, m, n]):
162 if ({a, b}, {c, d}) == ({m, n}, {p, q}):
163 continue
164 if ({a, b}, {c, d}) == ({p, q}, {m, n}):
165 continue
166
167 yield dict(zip('ABCDEFGH', [a, b, c, d, m, n, p, q]))
168
169
170def match_circle_coll_eqangle_midp(

Callers

nothing calls this directly

Calls 3

neighborsMethod · 0.80
check_nparaMethod · 0.80

Tested by

no test coverage detected