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

Method intersect

numericals.py:450–467  ·  view source on GitHub ↗
(self, obj: Union[Line, HalfLine, Circle, HoleCircle])

Source from the content-addressed store, hash-verified

448 self.hole = hole
449
450 def intersect(self, obj: Union[Line, HalfLine, Circle, HoleCircle]) -> Point:
451 if isinstance(obj, Line):
452 a, b = line_circle_intersection(obj, self)
453 if a.close(self.hole):
454 return b
455 return a
456 if isinstance(obj, HalfLine):
457 return obj.intersect(self)
458 if isinstance(obj, Circle):
459 a, b = circle_circle_intersection(obj, self)
460 if a.close(self.hole):
461 return b
462 return a
463 if isinstance(obj, HoleCircle):
464 a, b = circle_circle_intersection(obj, self)
465 if a.close(self.hole) or a.close(obj.hole):
466 return b
467 return a
468
469
470def solve_quad(a: float, b: float, c: float) -> tuple[float, float]:

Callers

nothing calls this directly

Calls 4

line_circle_intersectionFunction · 0.85
closeMethod · 0.80
intersectMethod · 0.45

Tested by

no test coverage detected