Match eqangle A B P Q C D P Q => para A B C D.
(
g: gh.Graph,
g_matcher: Callable[str, list[tuple[gm.Point, ...]]],
theorem: pr.Theorem,
)
| 403 | |
| 404 | |
| 405 | def match_eqangle_para( |
| 406 | g: gh.Graph, |
| 407 | g_matcher: Callable[str, list[tuple[gm.Point, ...]]], |
| 408 | theorem: pr.Theorem, |
| 409 | ) -> Generator[dict[str, gm.Point], None, None]: |
| 410 | """Match eqangle A B P Q C D P Q => para A B C D.""" |
| 411 | for measure in g.type2nodes[gm.Measure]: |
| 412 | angs = measure.neighbors(gm.Angle) |
| 413 | d12, d21 = defaultdict(list), defaultdict(list) |
| 414 | for ang in angs: |
| 415 | d1, d2 = ang.directions |
| 416 | if d1 is None or d2 is None: |
| 417 | continue |
| 418 | d12[d1].append(d2) |
| 419 | d21[d2].append(d1) |
| 420 | |
| 421 | for d1, d2s in d12.items(): |
| 422 | a, b = g.two_points_on_direction(d1) |
| 423 | for d2, d3 in utils.comb2(d2s): |
| 424 | c, d = g.two_points_on_direction(d2) |
| 425 | e, f = g.two_points_on_direction(d3) |
| 426 | yield dict(zip('ABCDPQ', [c, d, e, f, a, b])) |
| 427 | |
| 428 | |
| 429 | def match_cyclic_eqangle( |
nothing calls this directly
no test coverage detected