Match circle O A B C, coll M B C, eqangle A B A C O B O M => midp M B C.
(
g: gh.Graph,
g_matcher: Callable[str, list[tuple[gm.Point, ...]]],
theorem: pr.Theorem,
)
| 168 | |
| 169 | |
| 170 | def match_circle_coll_eqangle_midp( |
| 171 | g: gh.Graph, |
| 172 | g_matcher: Callable[str, list[tuple[gm.Point, ...]]], |
| 173 | theorem: pr.Theorem, |
| 174 | ) -> Generator[dict[str, gm.Point], None, None]: |
| 175 | """Match circle O A B C, coll M B C, eqangle A B A C O B O M => midp M B C.""" |
| 176 | for p, a, b, c in g.all_circles(): |
| 177 | ab = g._get_line(a, b) |
| 178 | if ab is None: |
| 179 | continue |
| 180 | if ab.val is None: |
| 181 | continue |
| 182 | ac = g._get_line(a, c) |
| 183 | if ac is None: |
| 184 | continue |
| 185 | if ac.val is None: |
| 186 | continue |
| 187 | pb = g._get_line(p, b) |
| 188 | if pb is None: |
| 189 | continue |
| 190 | if pb.val is None: |
| 191 | continue |
| 192 | |
| 193 | bc = g._get_line(b, c) |
| 194 | if bc is None: |
| 195 | continue |
| 196 | bc_points = bc.neighbors(gm.Point, return_set=True) |
| 197 | |
| 198 | anga, _ = g._get_angle(ab.val, ac.val) |
| 199 | |
| 200 | for angp in pb.val.neighbors(gm.Angle): |
| 201 | if not g.is_equal(anga, angp): |
| 202 | continue |
| 203 | |
| 204 | _, d = angp.directions |
| 205 | for l in d.neighbors(gm.Line): |
| 206 | l_points = l.neighbors(gm.Point, return_set=True) |
| 207 | m = intersect1(bc_points, l_points) |
| 208 | if m is not None: |
| 209 | yield dict(zip('ABCMO', [a, b, c, m, p])) |
| 210 | |
| 211 | |
| 212 | def match_midp_perp_cong( |
nothing calls this directly
no test coverage detected