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

Function circle_segment_intersect

numericals.py:555–566  ·  view source on GitHub ↗
(
    circle: Circle, p1: Point, p2: Point
)

Source from the content-addressed store, hash-verified

553
554
555def circle_segment_intersect(
556 circle: Circle, p1: Point, p2: Point
557) -> list[Point]:
558 l = Line(p1, p2)
559 px, py = line_circle_intersection(l, circle)
560
561 result = []
562 if _check_between(px, p1, p2):
563 result.append(px)
564 if _check_between(py, p1, p2):
565 result.append(py)
566 return result
567
568
569def line_segment_intersection(l: Line, A: Point, B: Point) -> Point: # pylint: disable=invalid-name

Callers 1

naming_positionFunction · 0.85

Calls 3

line_circle_intersectionFunction · 0.85
_check_betweenFunction · 0.85
LineClass · 0.70

Tested by

no test coverage detected