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

Function line_of_and_why

geometry.py:429–444  ·  view source on GitHub ↗

Why points are collinear.

(
    points: list[Point], level: int = None
)

Source from the content-addressed store, hash-verified

427
428
429def line_of_and_why(
430 points: list[Point], level: int = None
431) -> tuple[Line, list[Any]]:
432 """Why points are collinear."""
433 for l0 in get_lines_thru_all(*points):
434 for l in l0.equivs():
435 if all([p in l.edge_graph for p in points]):
436 x, y = l.points
437 colls = list({x, y} | set(points))
438 # if len(colls) < 3:
439 # return l, []
440 why = l.why_coll(colls, level)
441 if why is not None:
442 return l, why
443
444 return None, None
445
446
447def get_circles_thru_all(*points: list[Point]) -> list[Circle]:

Callers

nothing calls this directly

Calls 3

get_lines_thru_allFunction · 0.85
equivsMethod · 0.80
why_collMethod · 0.45

Tested by

no test coverage detected