Match eqangle A B P Q C D U V, perp P Q U V => perp A B C D.
(
g: gh.Graph,
g_matcher: Callable[str, list[tuple[gm.Point, ...]]],
theorem: pr.Theorem,
)
| 340 | |
| 341 | |
| 342 | def match_eqangle_perp_perp( |
| 343 | g: gh.Graph, |
| 344 | g_matcher: Callable[str, list[tuple[gm.Point, ...]]], |
| 345 | theorem: pr.Theorem, |
| 346 | ) -> Generator[dict[str, gm.Point], None, None]: |
| 347 | """Match eqangle A B P Q C D U V, perp P Q U V => perp A B C D.""" |
| 348 | for ang in g.vhalfpi.neighbors(gm.Angle): |
| 349 | # d1 perp d2 |
| 350 | d1, d2 = ang.directions |
| 351 | if d1 is None or d2 is None: |
| 352 | continue |
| 353 | for d3, d4 in utils.comb2(g.type2nodes[gm.Direction]): |
| 354 | if d1 == d3 or d2 == d4: |
| 355 | continue |
| 356 | # if d1 - d3 = d2 - d4 => d3 perp d4 |
| 357 | a13, a31 = g._get_angle(d1, d3) |
| 358 | a24, a42 = g._get_angle(d2, d4) |
| 359 | if a13 is None or a31 is None or a24 is None or a42 is None: |
| 360 | continue |
| 361 | if g.is_equal(a13, a24) and g.is_equal(a31, a42): |
| 362 | a, b = g.two_points_on_direction(d1) |
| 363 | c, d = g.two_points_on_direction(d2) |
| 364 | m, n = g.two_points_on_direction(d3) |
| 365 | p, q = g.two_points_on_direction(d4) |
| 366 | yield dict(zip('ABCDPQUV', [m, n, p, q, a, b, c, d])) |
| 367 | |
| 368 | |
| 369 | def match_eqangle_ncoll_cyclic( |
nothing calls this directly
no test coverage detected