Check whether a ratio is equal to some constant.
(self, points: list[Point])
| 2267 | return False |
| 2268 | |
| 2269 | def check_rcompute(self, points: list[Point]) -> bool: |
| 2270 | """Check whether a ratio is equal to some constant.""" |
| 2271 | a, b, c, d = points |
| 2272 | ab = self._get_segment(a, b) |
| 2273 | cd = self._get_segment(c, d) |
| 2274 | |
| 2275 | if not ab or not cd: |
| 2276 | return False |
| 2277 | |
| 2278 | if not (ab.val and cd.val): |
| 2279 | return False |
| 2280 | |
| 2281 | for rat0 in self.rconst.values(): |
| 2282 | for rat in rat0.val.neighbors(Ratio): |
| 2283 | l1, l2 = rat.lengths |
| 2284 | if ab.val == l1 and cd.val == l2: |
| 2285 | return True |
| 2286 | return False |
| 2287 | |
| 2288 | def check_eqratio(self, points: list[Point]) -> bool: |
| 2289 | """Check if 8 points make an eqratio predicate.""" |
no test coverage detected