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

Class HoleCircle

numericals.py:443–467  ·  view source on GitHub ↗

Numerical circle with a missing point.

Source from the content-addressed store, hash-verified

441
442
443class HoleCircle(Circle):
444 """Numerical circle with a missing point."""
445
446 def __init__(self, center: Point, radius: float, hole: Point):
447 super().__init__(center, radius)
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 1

sketch_hcircleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected