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

Method all_circles

graph.py:3013–3023  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3011 yield a, b, c
3012
3013 def all_circles(self) -> Generator[tuple[Point, ...], None, None]:
3014 for l in self.type2nodes[Length]:
3015 p2p = defaultdict(list)
3016 for s in l.neighbors(Segment):
3017 a, b = s.points
3018 p2p[a].append(b)
3019 p2p[b].append(a)
3020 for p, ps in p2p.items():
3021 if len(ps) >= 3:
3022 for a, b, c in utils.perm3(ps):
3023 yield p, a, b, c
3024
3025 def two_points_on_direction(self, d: Direction) -> tuple[Point, Point]:
3026 l = d.neighbors(Line)[0]

Callers 5

match_allFunction · 0.80

Calls 1

neighborsMethod · 0.80

Tested by 1