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

Method check_rcompute

graph.py:2269–2286  ·  view source on GitHub ↗

Check whether a ratio is equal to some constant.

(self, points: list[Point])

Source from the content-addressed store, hash-verified

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."""

Callers 1

checkMethod · 0.95

Calls 2

_get_segmentMethod · 0.95
neighborsMethod · 0.80

Tested by

no test coverage detected