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

Method get_line_thru_pair_why

graph.py:897–910  ·  view source on GitHub ↗

Get one line thru two given points and the corresponding dependency list.

(
      self, p1: Point, p2: Point
  )

Source from the content-addressed store, hash-verified

895 return line
896
897 def get_line_thru_pair_why(
898 self, p1: Point, p2: Point
899 ) -> tuple[Line, list[Dependency]]:
900 """Get one line thru two given points and the corresponding dependency list."""
901 if p1.name.lower() > p2.name.lower():
902 p1, p2 = p2, p1
903 if (p1, p2) in self._pair2line:
904 return self._pair2line[(p1, p2)].rep_and_why()
905
906 l, why = gm.line_of_and_why([p1, p2])
907 if l is None:
908 l = self.get_new_line_thru_pair(p1, p2)
909 why = []
910 return l, why
911
912 def coll_dep(self, points: list[Point], p: Point) -> list[Dependency]:
913 """Return the dep(.why) explaining why p is coll with points."""

Callers 7

add_algebraMethod · 0.95
add_paraMethod · 0.95
add_perpMethod · 0.95
add_eqangleMethod · 0.95
add_aconstMethod · 0.95
add_s_angleMethod · 0.95
why_meMethod · 0.80

Calls 2

rep_and_whyMethod · 0.80

Tested by

no test coverage detected